From d7999e9b294f93f68b5ec9e3efd8017fad3f05d9 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Wed, 25 Aug 2010 12:35:40 -0400 Subject: [PATCH] Rename strict-mode to warn-uninitialized --- Source/QtDialog/CMakeSetupDialog.cxx | 10 +++++----- Source/QtDialog/CMakeSetupDialog.h | 2 +- Source/QtDialog/QCMake.cxx | 10 +++++----- Source/QtDialog/QCMake.h | 6 +++--- Source/cmCommandArgumentParserHelper.cxx | 6 +++--- Source/cmCommandArgumentParserHelper.h | 2 +- Source/cmake.cxx | 8 ++++---- Source/cmake.h | 6 +++--- Source/cmakemain.cxx | 5 ++--- 9 files changed, 27 insertions(+), 28 deletions(-) diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx index 7600897bd..a5510afc0 100644 --- a/Source/QtDialog/CMakeSetupDialog.cxx +++ b/Source/QtDialog/CMakeSetupDialog.cxx @@ -117,9 +117,9 @@ CMakeSetupDialog::CMakeSetupDialog() this->SuppressDevWarningsAction = OptionsMenu->addAction(tr("&Suppress dev Warnings (-Wno-dev)")); this->SuppressDevWarningsAction->setCheckable(true); - this->StrictModeAction = - OptionsMenu->addAction(tr("&Strict Mode (--strict-mode)")); - this->StrictModeAction->setCheckable(true); + this->WarnUninitializedAction = + OptionsMenu->addAction(tr("&Warn Uninitialized (--warn-uninitialized)")); + this->WarnUninitializedAction->setCheckable(true); QAction* debugAction = OptionsMenu->addAction(tr("&Debug Output")); debugAction->setCheckable(true); @@ -244,9 +244,9 @@ void CMakeSetupDialog::initialize() QObject::connect(this->SuppressDevWarningsAction, SIGNAL(triggered(bool)), this->CMakeThread->cmakeInstance(), SLOT(setSuppressDevWarnings(bool))); - QObject::connect(this->StrictModeAction, SIGNAL(triggered(bool)), + QObject::connect(this->WarnUninitializedAction, SIGNAL(triggered(bool)), this->CMakeThread->cmakeInstance(), - SLOT(setStrictMode(bool))); + SLOT(setWarnUninitializedMode(bool))); if(!this->SourceDirectory->text().isEmpty() || !this->BinaryDirectory->lineEdit()->text().isEmpty()) diff --git a/Source/QtDialog/CMakeSetupDialog.h b/Source/QtDialog/CMakeSetupDialog.h index cd2be6e5f..4c161d9e2 100644 --- a/Source/QtDialog/CMakeSetupDialog.h +++ b/Source/QtDialog/CMakeSetupDialog.h @@ -93,7 +93,7 @@ protected: QAction* ConfigureAction; QAction* GenerateAction; QAction* SuppressDevWarningsAction; - QAction* StrictModeAction; + QAction* WarnUninitializedAction; QAction* InstallForCommandLineAction; State CurrentState; diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx index 31daf3c86..8d24c1c27 100644 --- a/Source/QtDialog/QCMake.cxx +++ b/Source/QtDialog/QCMake.cxx @@ -28,7 +28,7 @@ QCMake::QCMake(QObject* p) : QObject(p) { this->SuppressDevWarnings = false; - this->StrictMode = false; + this->WarnUninitializedMode = false; qRegisterMetaType(); qRegisterMetaType(); @@ -165,8 +165,8 @@ void QCMake::configure() this->CMakeInstance->CreateGlobalGenerator(this->Generator.toAscii().data())); this->CMakeInstance->LoadCache(); this->CMakeInstance->SetSuppressDevWarnings(this->SuppressDevWarnings); - std::cerr << "set strict " << this->StrictMode << "\n"; - this->CMakeInstance->SetStrictMode(this->StrictMode); + std::cerr << "set warn uninitialized " << this->WarnUninitializedMode << "\n"; + this->CMakeInstance->SetWarnUninitialized(this->WarnUninitializedMode); this->CMakeInstance->PreLoadCMakeFiles(); cmSystemTools::ResetErrorOccuredFlag(); @@ -421,7 +421,7 @@ void QCMake::setSuppressDevWarnings(bool value) this->SuppressDevWarnings = value; } -void QCMake::setStrictMode(bool value) +void QCMake::setWarnUninitializedMode(bool value) { - this->StrictMode = value; + this->WarnUninitializedMode = value; } diff --git a/Source/QtDialog/QCMake.h b/Source/QtDialog/QCMake.h index f20893f22..6d2b2fff5 100644 --- a/Source/QtDialog/QCMake.h +++ b/Source/QtDialog/QCMake.h @@ -88,8 +88,8 @@ public slots: void setDebugOutput(bool); /// set whether to do suppress dev warnings void setSuppressDevWarnings(bool value); - /// set whether to run cmake in strict mode - void setStrictMode(bool value); + /// set whether to run cmake with warnings about uninitialized variables + void setWarnUninitializedMode(bool value); public: /// get the list of cache properties @@ -135,7 +135,7 @@ protected: static void errorCallback(const char* msg, const char* title, bool&, void* cd); bool SuppressDevWarnings; - bool StrictMode; + bool WarnUninitializedMode; QString SourceDirectory; QString BinaryDirectory; QString Generator; diff --git a/Source/cmCommandArgumentParserHelper.cxx b/Source/cmCommandArgumentParserHelper.cxx index d955ff7e0..1460e5ddd 100644 --- a/Source/cmCommandArgumentParserHelper.cxx +++ b/Source/cmCommandArgumentParserHelper.cxx @@ -20,7 +20,7 @@ int cmCommandArgument_yyparse( yyscan_t yyscanner ); // cmCommandArgumentParserHelper::cmCommandArgumentParserHelper() { - this->StrictMode = false; + this->WarnUninitialized = false; this->FileLine = -1; this->FileName = 0; this->RemoveEmpty = true; @@ -127,7 +127,7 @@ char* cmCommandArgumentParserHelper::ExpandVariable(const char* var) // check to see if we need to print a warning // if strict mode is on and the variable has // not been "cleared"/initialized with a set(foo ) call - if(this->StrictMode && !this->Makefile->VariableInitialized(var)) + if(this->WarnUninitialized && !this->Makefile->VariableInitialized(var)) { cmOStringStream msg; msg << this->FileName << ":" << this->FileLine << ":" << @@ -330,7 +330,7 @@ void cmCommandArgumentParserHelper::Error(const char* str) void cmCommandArgumentParserHelper::SetMakefile(const cmMakefile* mf) { this->Makefile = mf; - this->StrictMode = mf->GetCMakeInstance()->GetStrictMode(); + this->WarnUninitialized = mf->GetCMakeInstance()->GetWarnUninitialized(); } void cmCommandArgumentParserHelper::SetResult(const char* value) diff --git a/Source/cmCommandArgumentParserHelper.h b/Source/cmCommandArgumentParserHelper.h index d7206ee97..1df004244 100644 --- a/Source/cmCommandArgumentParserHelper.h +++ b/Source/cmCommandArgumentParserHelper.h @@ -96,7 +96,7 @@ private: const cmMakefile* Makefile; std::string Result; const char* FileName; - bool StrictMode; + bool WarnUninitialized; long FileLine; bool EscapeQuotes; std::string ErrorString; diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 41f2775ac..f68ab3ef1 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -140,7 +140,7 @@ void cmNeedBackwardsCompatibility(const std::string& variable, cmake::cmake() { this->Trace = false; - this->StrictMode = false; + this->WarnUninitialized = false; this->FindUnused = false; this->DefaultToUsed = false; this->SuppressDevWarnings = false; @@ -616,10 +616,10 @@ void cmake::SetArgs(const std::vector& args) std::cout << "Running with trace output on.\n"; this->SetTrace(true); } - else if(arg.find("--strict-mode",0) == 0) + else if(arg.find("--warn-uninitialized",0) == 0) { - std::cout << "Running in strict mode.\n"; - this->SetStrictMode(true); + std::cout << "Warn about uninitialized values.\n"; + this->SetWarnUninitialized(true); } else if(arg.find("--find-unused",0) == 0) { diff --git a/Source/cmake.h b/Source/cmake.h index 7b612ea70..3a53d481d 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -306,8 +306,8 @@ class cmake // Do we want trace output during the cmake run. bool GetTrace() { return this->Trace;} void SetTrace(bool b) { this->Trace = b;} - bool GetStrictMode() { return this->StrictMode;} - void SetStrictMode(bool b) { this->StrictMode = b;} + bool GetWarnUninitialized() { return this->WarnUninitialized;} + void SetWarnUninitialized(bool b) { this->WarnUninitialized = b;} bool GetFindUnused() { return this->FindUnused;} void SetFindUnused(bool b) { this->FindUnused = b;} bool GetDefaultToUsed() { return this->DefaultToUsed;} @@ -449,7 +449,7 @@ private: bool ScriptMode; bool DebugOutput; bool Trace; - bool StrictMode; + bool WarnUninitialized; bool FindUnused; bool DefaultToUsed; std::string CMakeEditCommand; diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index 235aaf527..af922000b 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -120,9 +120,8 @@ static const char * cmDocumentationOptions[][3] = {"--trace", "Put cmake in trace mode.", "Print a trace of all calls made and from where with " "message(send_error ) calls."}, - {"--strict-mode", "Put cmake in strict mode.", - "In strict mode cmake will print a warning when an uninitialized variable " - "is used."}, + {"--warn-uninitialized", "Warn about uninitialized values.", + "Print a warning when an uninitialized variable is used."}, {"--find-unused", "Find unused variables.", "Find variables that are declared on the command line, but not used."}, {"--find-unused-all", "Find all unused variables.",