Fixed #4618 (Unmatched suppression: don't show this information message unless --enable=information or --check-cfg is used)
This commit is contained in:
parent
065853a59a
commit
a7da65a40b
|
@ -191,10 +191,10 @@ int CppCheckExecutor::check(int argc, const char* const argv[])
|
|||
returnValue = executor.check();
|
||||
}
|
||||
|
||||
if (!settings.checkConfiguration) {
|
||||
if (!settings._errorsOnly)
|
||||
reportUnmatchedSuppressions(settings.nomsg.getUnmatchedGlobalSuppressions());
|
||||
if (settings.isEnabled("information") || settings.checkConfiguration)
|
||||
reportUnmatchedSuppressions(settings.nomsg.getUnmatchedGlobalSuppressions());
|
||||
|
||||
if (!settings.checkConfiguration) {
|
||||
cppCheck.tooManyConfigsError("",0U);
|
||||
|
||||
if (settings.isEnabled("missingInclude") && Preprocessor::missingIncludeFlag) {
|
||||
|
|
|
@ -215,7 +215,7 @@ unsigned int CppCheck::processFile(const std::string& filename)
|
|||
internalError(filename, e.errorMessage);
|
||||
}
|
||||
|
||||
if (!_settings._errorsOnly)
|
||||
if (_settings.isEnabled("information") || _settings.checkConfiguration)
|
||||
reportUnmatchedSuppressions(_settings.nomsg.getUnmatchedLocalSuppressions(filename));
|
||||
|
||||
_errorList.clear();
|
||||
|
|
|
@ -121,6 +121,7 @@ private:
|
|||
CppCheck cppCheck(*this, true);
|
||||
Settings& settings = cppCheck.settings();
|
||||
settings._inlineSuppressions = true;
|
||||
settings.addEnabled("information");
|
||||
if (!suppression.empty()) {
|
||||
std::string r = settings.nomsg.addSuppressionLine(suppression);
|
||||
ASSERT_EQUALS("", r);
|
||||
|
@ -141,6 +142,7 @@ private:
|
|||
Settings settings;
|
||||
settings._jobs = 1;
|
||||
settings._inlineSuppressions = true;
|
||||
settings.addEnabled("information");
|
||||
if (!suppression.empty()) {
|
||||
std::string r = settings.nomsg.addSuppressionLine(suppression);
|
||||
ASSERT_EQUALS("", r);
|
||||
|
@ -162,6 +164,7 @@ private:
|
|||
CppCheck cppCheck(*this, true);
|
||||
Settings& settings = cppCheck.settings();
|
||||
settings._inlineSuppressions = true;
|
||||
settings.addEnabled("information");
|
||||
if (!suppression.empty())
|
||||
settings.nomsg.addSuppressionLine(suppression);
|
||||
|
||||
|
|
Loading…
Reference in New Issue