diff options
Diffstat (limited to 'libsolidity/analysis/StaticAnalyzer.cpp')
-rw-r--r-- | libsolidity/analysis/StaticAnalyzer.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/libsolidity/analysis/StaticAnalyzer.cpp b/libsolidity/analysis/StaticAnalyzer.cpp index 2f130414..d012c25d 100644 --- a/libsolidity/analysis/StaticAnalyzer.cpp +++ b/libsolidity/analysis/StaticAnalyzer.cpp @@ -69,7 +69,16 @@ void StaticAnalyzer::endVisit(FunctionDefinition const&) m_constructor = false; for (auto const& var: m_localVarUseCount) if (var.second == 0) - m_errorReporter.warning(var.first->location(), "Unused local variable"); + { + if (var.first->isCallableParameter()) + m_errorReporter.warning( + var.first->location(), + "Unused function parameter. Remove or comment out the variable name to silence this warning." + ); + else + m_errorReporter.warning(var.first->location(), "Unused local variable."); + } + m_localVarUseCount.clear(); } |