summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2010-04-13 13:21:31 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2010-09-01 17:08:13 (GMT)
commit48b5b855934be341c02139c0bed88c35c1b40d8f (patch)
tree932548a1470f02f2949e3c26ff3e95f5c12f2284 /Source/cmMakefile.cxx
parentcd626ea66ed114736ddf5d6a4c989ef6c9b8d248 (diff)
downloadCMake-48b5b855934be341c02139c0bed88c35c1b40d8f.zip
CMake-48b5b855934be341c02139c0bed88c35c1b40d8f.tar.gz
CMake-48b5b855934be341c02139c0bed88c35c1b40d8f.tar.bz2
Add a warning when variables are used uninitialized.
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 8eece6b..c56641c 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -43,6 +43,7 @@ class cmMakefile::Internals
{
public:
std::stack<cmDefinitions, std::list<cmDefinitions> > VarStack;
+ std::set<cmStdString> VarRemoved;
};
// default is not to be building executables
@@ -1694,9 +1695,19 @@ void cmMakefile::AddDefinition(const char* name, bool value)
#endif
}
+bool cmMakefile::VariableCleared(const char* var) const
+{
+ if(this->Internal->VarRemoved.find(var) != this->Internal->VarRemoved.end())
+ {
+ return true;
+ }
+ return false;
+}
+
void cmMakefile::RemoveDefinition(const char* name)
{
this->Internal->VarStack.top().Set(name, 0);
+ this->Internal->VarRemoved.insert(name);
#ifdef CMAKE_BUILD_WITH_CMAKE
cmVariableWatch* vv = this->GetVariableWatch();
if ( vv )