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();
|
returnValue = executor.check();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!settings.checkConfiguration) {
|
if (settings.isEnabled("information") || settings.checkConfiguration)
|
||||||
if (!settings._errorsOnly)
|
reportUnmatchedSuppressions(settings.nomsg.getUnmatchedGlobalSuppressions());
|
||||||
reportUnmatchedSuppressions(settings.nomsg.getUnmatchedGlobalSuppressions());
|
|
||||||
|
|
||||||
|
if (!settings.checkConfiguration) {
|
||||||
cppCheck.tooManyConfigsError("",0U);
|
cppCheck.tooManyConfigsError("",0U);
|
||||||
|
|
||||||
if (settings.isEnabled("missingInclude") && Preprocessor::missingIncludeFlag) {
|
if (settings.isEnabled("missingInclude") && Preprocessor::missingIncludeFlag) {
|
||||||
|
@ -215,7 +215,7 @@ unsigned int CppCheck::processFile(const std::string& filename)
|
|||||||
internalError(filename, e.errorMessage);
|
internalError(filename, e.errorMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_settings._errorsOnly)
|
if (_settings.isEnabled("information") || _settings.checkConfiguration)
|
||||||
reportUnmatchedSuppressions(_settings.nomsg.getUnmatchedLocalSuppressions(filename));
|
reportUnmatchedSuppressions(_settings.nomsg.getUnmatchedLocalSuppressions(filename));
|
||||||
|
|
||||||
_errorList.clear();
|
_errorList.clear();
|
||||||
|
@ -121,6 +121,7 @@ private:
|
|||||||
CppCheck cppCheck(*this, true);
|
CppCheck cppCheck(*this, true);
|
||||||
Settings& settings = cppCheck.settings();
|
Settings& settings = cppCheck.settings();
|
||||||
settings._inlineSuppressions = true;
|
settings._inlineSuppressions = true;
|
||||||
|
settings.addEnabled("information");
|
||||||
if (!suppression.empty()) {
|
if (!suppression.empty()) {
|
||||||
std::string r = settings.nomsg.addSuppressionLine(suppression);
|
std::string r = settings.nomsg.addSuppressionLine(suppression);
|
||||||
ASSERT_EQUALS("", r);
|
ASSERT_EQUALS("", r);
|
||||||
@ -141,6 +142,7 @@ private:
|
|||||||
Settings settings;
|
Settings settings;
|
||||||
settings._jobs = 1;
|
settings._jobs = 1;
|
||||||
settings._inlineSuppressions = true;
|
settings._inlineSuppressions = true;
|
||||||
|
settings.addEnabled("information");
|
||||||
if (!suppression.empty()) {
|
if (!suppression.empty()) {
|
||||||
std::string r = settings.nomsg.addSuppressionLine(suppression);
|
std::string r = settings.nomsg.addSuppressionLine(suppression);
|
||||||
ASSERT_EQUALS("", r);
|
ASSERT_EQUALS("", r);
|
||||||
@ -162,6 +164,7 @@ private:
|
|||||||
CppCheck cppCheck(*this, true);
|
CppCheck cppCheck(*this, true);
|
||||||
Settings& settings = cppCheck.settings();
|
Settings& settings = cppCheck.settings();
|
||||||
settings._inlineSuppressions = true;
|
settings._inlineSuppressions = true;
|
||||||
|
settings.addEnabled("information");
|
||||||
if (!suppression.empty())
|
if (!suppression.empty())
|
||||||
settings.nomsg.addSuppressionLine(suppression);
|
settings.nomsg.addSuppressionLine(suppression);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user