summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/cmMakefile.cxx10
-rw-r--r--Source/cmMakefile.h2
2 files changed, 7 insertions, 5 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 592e05e..df871ec 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1771,7 +1771,7 @@ bool cmMakefile::VariableCleared(const char* var) const
return false;
}
-bool cmMakefile::CheckForUnused(const char* reason, const char* name)
+void cmMakefile::CheckForUnused(const char* reason, const char* name) const
{
if (this->WarnUnused && !this->VariableUsed(name))
{
@@ -1786,10 +1786,8 @@ bool cmMakefile::CheckForUnused(const char* reason, const char* name)
msg << file->FilePath << ":" << file->Line << ":" <<
" warning: (" << reason << ") unused variable \'" << name << "\'";
cmSystemTools::Message(msg.str().c_str());
- return true;
}
}
- return false;
}
void cmMakefile::RemoveDefinition(const char* name)
@@ -3429,7 +3427,11 @@ void cmMakefile::PopScope()
for (; it != locals.end(); ++it)
{
init.erase(*it);
- if (!this->CheckForUnused("out of scope", it->c_str()))
+ if (!this->VariableUsed(it->c_str()))
+ {
+ this->CheckForUnused("out of scope", it->c_str());
+ }
+ else
{
usage.erase(*it);
}
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 6b0bfa2..7826903 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -844,7 +844,7 @@ protected:
void AddGlobalLinkInformation(const char* name, cmTarget& target);
// Check for a an unused variable
- bool CheckForUnused(const char* reason, const char* name);
+ void CheckForUnused(const char* reason, const char* name) const;
std::string Prefix;
std::vector<std::string> AuxSourceDirectories; //