summaryrefslogtreecommitdiff
path: root/Source/cmCommandArgumentParserHelper.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2010-04-13 09:21:31 -0400
committerBen Boeckel <ben.boeckel@kitware.com>2010-09-01 13:08:13 -0400
commit48b5b855934be341c02139c0bed88c35c1b40d8f (patch)
tree932548a1470f02f2949e3c26ff3e95f5c12f2284 /Source/cmCommandArgumentParserHelper.cxx
parentcd626ea66ed114736ddf5d6a4c989ef6c9b8d248 (diff)
downloadcmake-48b5b855934be341c02139c0bed88c35c1b40d8f.tar.gz
Add a warning when variables are used uninitialized.
Diffstat (limited to 'Source/cmCommandArgumentParserHelper.cxx')
-rw-r--r--Source/cmCommandArgumentParserHelper.cxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/Source/cmCommandArgumentParserHelper.cxx b/Source/cmCommandArgumentParserHelper.cxx
index 234c37e56b..027a2ba780 100644
--- a/Source/cmCommandArgumentParserHelper.cxx
+++ b/Source/cmCommandArgumentParserHelper.cxx
@@ -119,10 +119,15 @@ char* cmCommandArgumentParserHelper::ExpandVariable(const char* var)
cmOStringStream ostr;
ostr << this->FileLine;
return this->AddString(ostr.str().c_str());
- }
+ }
const char* value = this->Makefile->GetDefinition(var);
if(!value && !this->RemoveEmpty)
{
+ if(!this->Makefile->VariableCleared(var))
+ {
+ std::cerr << this->FileName << ":" << this->FileLine << ":" <<
+ " warning: uninitialized variable \'" << var << "\'\n";
+ }
return 0;
}
if (this->EscapeQuotes && value)