de-coupled `--check-library` from `information` severity and other dependencies (#3861)

This commit is contained in:
Oliver Stöneberg 2023-01-26 22:28:04 +01:00 committed by GitHub
parent ca0c13e27d
commit fd15811215
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
35 changed files with 48 additions and 46 deletions

View File

@ -246,8 +246,6 @@ bool CmdLineParser::parseFromArgs(int argc, const char* const argv[])
// Check library definitions // Check library definitions
else if (std::strcmp(argv[i], "--check-library") == 0) { else if (std::strcmp(argv[i], "--check-library") == 0) {
mSettings->checkLibrary = true; mSettings->checkLibrary = true;
// need to add "information" or no messages will be shown at all
mSettings->addEnabled("information");
} }
else if (std::strncmp(argv[i], "--checks-max-time=", 18) == 0) { else if (std::strncmp(argv[i], "--checks-max-time=", 18) == 0) {

View File

@ -594,7 +594,7 @@ void CheckFunctions::memsetValueOutOfRangeError(const Token *tok, const std::str
void CheckFunctions::checkLibraryMatchFunctions() void CheckFunctions::checkLibraryMatchFunctions()
{ {
if (!mSettings->checkLibrary || !mSettings->severity.isEnabled(Severity::information)) if (!mSettings->checkLibrary)
return; return;
bool insideNew = false; bool insideNew = false;

View File

@ -169,7 +169,7 @@ void CheckLeakAutoVar::deallocReturnError(const Token *tok, const Token *dealloc
void CheckLeakAutoVar::configurationInfo(const Token* tok, const std::string &functionName) void CheckLeakAutoVar::configurationInfo(const Token* tok, const std::string &functionName)
{ {
if (mSettings->checkLibrary && mSettings->severity.isEnabled(Severity::information)) { if (mSettings->checkLibrary) {
reportError(tok, reportError(tok,
Severity::information, Severity::information,
"checkLibraryUseIgnore", "checkLibraryUseIgnore",

View File

@ -1147,14 +1147,14 @@ void CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(const Scope* const
void CheckUnusedVar::checkFunctionVariableUsage() void CheckUnusedVar::checkFunctionVariableUsage()
{ {
if (!mSettings->severity.isEnabled(Severity::style)) if (!mSettings->severity.isEnabled(Severity::style) && !mSettings->checkLibrary)
return; return;
// Parse all executing scopes.. // Parse all executing scopes..
const SymbolDatabase *symbolDatabase = mTokenizer->getSymbolDatabase(); const SymbolDatabase *symbolDatabase = mTokenizer->getSymbolDatabase();
auto reportLibraryCfgError = [this](const Token* tok, const std::string& typeName) { auto reportLibraryCfgError = [this](const Token* tok, const std::string& typeName) {
if (mSettings->checkLibrary && mSettings->severity.isEnabled(Severity::information)) { if (mSettings->checkLibrary) {
reportError(tok, reportError(tok,
Severity::information, Severity::information,
"checkLibraryCheckType", "checkLibraryCheckType",
@ -1380,16 +1380,25 @@ void CheckUnusedVar::checkFunctionVariableUsage()
void CheckUnusedVar::unusedVariableError(const Token *tok, const std::string &varname) void CheckUnusedVar::unusedVariableError(const Token *tok, const std::string &varname)
{ {
if (!mSettings->severity.isEnabled(Severity::style))
return;
reportError(tok, Severity::style, "unusedVariable", "$symbol:" + varname + "\nUnused variable: $symbol", CWE563, Certainty::normal); reportError(tok, Severity::style, "unusedVariable", "$symbol:" + varname + "\nUnused variable: $symbol", CWE563, Certainty::normal);
} }
void CheckUnusedVar::allocatedButUnusedVariableError(const Token *tok, const std::string &varname) void CheckUnusedVar::allocatedButUnusedVariableError(const Token *tok, const std::string &varname)
{ {
if (!mSettings->severity.isEnabled(Severity::style))
return;
reportError(tok, Severity::style, "unusedAllocatedMemory", "$symbol:" + varname + "\nVariable '$symbol' is allocated memory that is never used.", CWE563, Certainty::normal); reportError(tok, Severity::style, "unusedAllocatedMemory", "$symbol:" + varname + "\nVariable '$symbol' is allocated memory that is never used.", CWE563, Certainty::normal);
} }
void CheckUnusedVar::unreadVariableError(const Token *tok, const std::string &varname, bool modified) void CheckUnusedVar::unreadVariableError(const Token *tok, const std::string &varname, bool modified)
{ {
if (!mSettings->severity.isEnabled(Severity::style))
return;
if (modified) if (modified)
reportError(tok, Severity::style, "unreadVariable", "$symbol:" + varname + "\nVariable '$symbol' is modified but its new value is never used.", CWE563, Certainty::normal); reportError(tok, Severity::style, "unreadVariable", "$symbol:" + varname + "\nVariable '$symbol' is modified but its new value is never used.", CWE563, Certainty::normal);
else else
@ -1398,6 +1407,9 @@ void CheckUnusedVar::unreadVariableError(const Token *tok, const std::string &va
void CheckUnusedVar::unassignedVariableError(const Token *tok, const std::string &varname) void CheckUnusedVar::unassignedVariableError(const Token *tok, const std::string &varname)
{ {
if (!mSettings->severity.isEnabled(Severity::style))
return;
reportError(tok, Severity::style, "unassignedVariable", "$symbol:" + varname + "\nVariable '$symbol' is not assigned a value.", CWE665, Certainty::normal); reportError(tok, Severity::style, "unassignedVariable", "$symbol:" + varname + "\nVariable '$symbol' is not assigned a value.", CWE665, Certainty::normal);
} }

View File

@ -7172,7 +7172,7 @@ bool Tokenizer::isScopeNoReturn(const Token *endScopeToken, bool *unknown) const
} }
if (unknown) if (unknown)
*unknown = !unknownFunc.empty(); *unknown = !unknownFunc.empty();
if (!unknownFunc.empty() && mSettings->checkLibrary && mSettings->severity.isEnabled(Severity::information)) { if (!unknownFunc.empty() && mSettings->checkLibrary) {
bool warn = true; bool warn = true;
if (Token::simpleMatch(endScopeToken->tokAt(-2), ") ; }")) { if (Token::simpleMatch(endScopeToken->tokAt(-2), ") ; }")) {
const Token * const ftok = endScopeToken->linkAt(-2)->previous(); const Token * const ftok = endScopeToken->linkAt(-2)->previous();

View File

@ -1360,9 +1360,9 @@ Checking minsize.c...
<programlisting># cppcheck noreturn.c <programlisting># cppcheck noreturn.c
Checking noreturn.c...</programlisting> Checking noreturn.c...</programlisting>
<para>しかし、<literal>--check-library</literal> と<literal>--enable=information</literal>をつかうとエラーが出力されます。:</para> <para>しかし、<literal>--check-library</literal> をつかうとエラーが出力されます。:</para>
<programlisting># cppcheck --check-library --enable=information noreturn.c <programlisting># cppcheck --check-library noreturn.c
Checking noreturn.c... Checking noreturn.c...
[noreturn.c:7]: (information) --check-library: Function ZeroMemory() should have &lt;noreturn&gt; configuration [noreturn.c:7]: (information) --check-library: Function ZeroMemory() should have &lt;noreturn&gt; configuration
</programlisting> </programlisting>

View File

@ -925,7 +925,7 @@ Cppcheck already contains configurations for several libraries. They can be load
## Using your own custom .cfg file ## Using your own custom .cfg file
You can create and use your own .cfg files for your projects. Use `--check-library` and `--enable=information` to get hints about what you should configure. You can create and use your own .cfg files for your projects. Use `--check-library` to get hints about what you should configure.
You can use the `Library Editor` in the `Cppcheck GUI` to edit configuration files. It is available in the `View` menu. You can use the `Library Editor` in the `Cppcheck GUI` to edit configuration files. It is available in the `View` menu.

View File

@ -89,7 +89,7 @@ If instead `dostuff` takes care of the memory then this can be configured with:
</memory> </memory>
</def> </def>
The `<use>` configuration has no logical purpose. You will get the same warnings without it. Use it to silence --check-library information messages. The `<use>` configuration has no logical purpose. You will get the same warnings without it. Use it to silence `--check-library` information messages.
# Function behavior # Function behavior
@ -397,9 +397,9 @@ In theory, if ZeroMemory terminates the program then there is no bug. Cppcheck t
$ cppcheck noreturn.c $ cppcheck noreturn.c
Checking noreturn.c... Checking noreturn.c...
However if you use `--check-library` and `--enable=information` you'll get this: However if you use `--check-library` you'll get this:
$ cppcheck --check-library --enable=information noreturn.c $ cppcheck --check-library noreturn.c
Checking noreturn.c... Checking noreturn.c...
[noreturn.c:7]: (information) --check-library: Function ZeroMemory() should have <noreturn> configuration [noreturn.c:7]: (information) --check-library: Function ZeroMemory() should have <noreturn> configuration

View File

@ -2,7 +2,7 @@
// Test library configuration for boost.cfg // Test library configuration for boost.cfg
// //
// Usage: // Usage:
// $ cppcheck --check-library --enable=information --error-exitcode=1 --suppress=missingIncludeSystem --inline-suppr test/cfg/boost.cpp // $ cppcheck --check-library --library=boost --enable=style --error-exitcode=1 --suppress=missingIncludeSystem --inline-suppr test/cfg/boost.cpp
// => // =>
// No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0 // No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0
// //

View File

@ -1,7 +1,7 @@
// Test library configuration for bsd.cfg // Test library configuration for bsd.cfg
// //
// Usage: // Usage:
// $ cppcheck --library=bsd --check-library --enable=information --error-exitcode=1 --suppress=missingIncludeSystem --inline-suppr test/cfg/bsd.c // $ cppcheck --check-library --library=bsd --enable=style --error-exitcode=1 --suppress=missingIncludeSystem --inline-suppr test/cfg/bsd.c
// => // =>
// No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0 // No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0
// //

View File

@ -2,7 +2,7 @@
// Test library configuration for cairo.cfg // Test library configuration for cairo.cfg
// //
// Usage: // Usage:
// $ cppcheck --check-library --library=cairo --enable=information --error-exitcode=1 --inline-suppr --suppress=missingIncludeSystem test/cfg/cairo.c // $ cppcheck --check-library --library=cairo --enable=style --error-exitcode=1 --suppress=missingIncludeSystem --inline-suppr test/cfg/cairo.c
// => // =>
// No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0 // No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0
// //

View File

@ -1,7 +1,7 @@
// Test library configuration for cppunit.cfg // Test library configuration for cppunit.cfg
// //
// Usage: // Usage:
// $ cppcheck --check-library --enable=information --error-exitcode=1 --suppress=missingIncludeSystem --inline-suppr test/cfg/cppunit.cpp // $ cppcheck --check-library --library=cppunit --enable=style --error-exitcode=1 --suppress=missingIncludeSystem --inline-suppr test/cfg/cppunit.cpp
// => // =>
// No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0 // No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0
// //

View File

@ -2,7 +2,7 @@
// Test library configuration for gnu.cfg // Test library configuration for gnu.cfg
// //
// Usage: // Usage:
// $ cppcheck --check-library --library=gnu --enable=information --enable=style --error-exitcode=1 --suppress=missingIncludeSystem --inline-suppr test/cfg/gnu.c // $ cppcheck --check-library --library=gnu --enable=style --error-exitcode=1 --suppress=missingIncludeSystem --inline-suppr test/cfg/gnu.c
// => // =>
// No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0 // No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0
// //

View File

@ -2,7 +2,7 @@
// Test library configuration for googletest.cfg // Test library configuration for googletest.cfg
// //
// Usage: // Usage:
// $ cppcheck --check-library --library=googletest --enable=information --error-exitcode=1 --inline-suppr --suppress=missingIncludeSystem test/cfg/googletest.cpp // $ cppcheck --check-library --library=googletest --enable=style --error-exitcode=1 --suppress=missingIncludeSystem --inline-suppr test/cfg/googletest.cpp
// => // =>
// No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0 // No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0
// //

View File

@ -2,7 +2,7 @@
// Test library configuration for gtk.cfg // Test library configuration for gtk.cfg
// //
// Usage: // Usage:
// $ cppcheck --check-library --enable=information --inconclusive --error-exitcode=1 --suppress=missingIncludeSystem --inline-suppr --library=gtk test/cfg/gtk.cpp // $ cppcheck --check-library --library=gtk --enable=style --error-exitcode=1 --suppress=missingIncludeSystem --inline-suppr --library=gtk test/cfg/gtk.cpp
// => // =>
// No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0 // No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0
// //

View File

@ -2,7 +2,7 @@
// Test library configuration for kde.cfg // Test library configuration for kde.cfg
// //
// Usage: // Usage:
// $ cppcheck --check-library --enable=information --error-exitcode=1 --suppress=missingIncludeSystem --inline-suppr test/cfg/kde.cpp // $ cppcheck --check-library --library=kde --enable=style --error-exitcode=1 --suppress=missingIncludeSystem --inline-suppr test/cfg/kde.cpp
// => // =>
// No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0 // No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0
// //

View File

@ -2,7 +2,7 @@
// Test library configuration for libcurl.cfg // Test library configuration for libcurl.cfg
// //
// Usage: // Usage:
// $ cppcheck --check-library --library=libcurl --enable=information --error-exitcode=1 --inline-suppr --suppress=missingIncludeSystem test/cfg/libcurl.c // $ cppcheck --check-library --library=libcurl --enable=style --error-exitcode=1 --suppress=missingIncludeSystem --inline-suppr test/cfg/libcurl.c
// => // =>
// No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0 // No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0
// //

View File

@ -2,7 +2,7 @@
// Test library configuration for libsigc++.cfg // Test library configuration for libsigc++.cfg
// //
// Usage: // Usage:
// $ cppcheck --check-library --enable=information --error-exitcode=1 --suppress=missingIncludeSystem --inline-suppr test/cfg/libsigc++.cpp // $ cppcheck --check-library --library=libsigc++ --enable=style --error-exitcode=1 --suppress=missingIncludeSystem --inline-suppr test/cfg/libsigc++.cpp
// => // =>
// No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0 // No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0
// //

View File

@ -2,7 +2,7 @@
// Test library configuration for lua.cfg // Test library configuration for lua.cfg
// //
// Usage: // Usage:
// $ cppcheck --check-library --library=lua --enable=information --error-exitcode=1 --inline-suppr --suppress=missingIncludeSystem test/cfg/lua.c // $ cppcheck --check-library --library=lua --enable=style --error-exitcode=1 --suppress=missingIncludeSystem --inline-suppr test/cfg/lua.c
// => // =>
// No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0 // No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0
// //

View File

@ -2,7 +2,7 @@
// Test library configuration for opencv2.cfg // Test library configuration for opencv2.cfg
// //
// Usage: // Usage:
// $ cppcheck --check-library --library=cairo --enable=information --error-exitcode=1 --inline-suppr --suppress=missingIncludeSystem test/cfg/opencv2.cpp // $ cppcheck --check-library --library=opencv2 --enable=style --error-exitcode=1 --suppress=missingIncludeSystem --inline-suppr test/cfg/opencv2.cpp
// => // =>
// No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0 // No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0
// //

View File

@ -2,7 +2,7 @@
// Test library configuration for openmp.cfg // Test library configuration for openmp.cfg
// //
// Usage: // Usage:
// $ cppcheck --check-library --library=openmp --enable=information --error-exitcode=1 --inline-suppr --suppress=missingIncludeSystem test/cfg/openmp.c // $ cppcheck --check-library --library=openmp --error-exitcode=1 --suppress=missingIncludeSystem --inline-suppr test/cfg/openmp.c
// => // =>
// No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0 // No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0
// //

View File

@ -2,7 +2,7 @@
// Test library configuration for openssl.cfg // Test library configuration for openssl.cfg
// //
// Usage: // Usage:
// $ cppcheck --check-library --library=openssl --enable=information --error-exitcode=1 --inline-suppr --suppress=missingIncludeSystem test/cfg/openssl.c // $ cppcheck --check-library --library=openssl --enable=style --error-exitcode=1 --suppress=missingIncludeSystem --inline-suppr test/cfg/openssl.c
// => // =>
// No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0 // No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0
// //

View File

@ -2,7 +2,7 @@
// Test library configuration for posix.cfg // Test library configuration for posix.cfg
// //
// Usage: // Usage:
// $ cppcheck --check-library --library=posix --enable=information --error-exitcode=1 --inline-suppr --suppress=missingIncludeSystem test/cfg/posix.c // $ cppcheck --check-library --library=posix --enable=style --error-exitcode=1 --suppress=missingIncludeSystem --inline-suppr test/cfg/posix.c
// => // =>
// No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0 // No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0
// //

View File

@ -2,7 +2,7 @@
// Test library configuration for python.cfg // Test library configuration for python.cfg
// //
// Usage: // Usage:
// $ cppcheck --check-library --library=python --enable=information --error-exitcode=1 --inline-suppr --suppress=missingIncludeSystem test/cfg/python.c // $ cppcheck --check-library --library=python --enable=style --error-exitcode=1 --suppress=missingIncludeSystem --inline-suppr test/cfg/python.c
// => // =>
// No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0 // No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0
// //

View File

@ -2,7 +2,7 @@
// Test library configuration for qt.cfg // Test library configuration for qt.cfg
// //
// Usage: // Usage:
// $ cppcheck --check-library --enable=information --inconclusive --error-exitcode=1 --suppress=missingIncludeSystem --inline-suppr --library=qt test/cfg/qt.cpp // $ cppcheck --check-library --library=qt --enable=style --error-exitcode=1 --suppress=missingIncludeSystem --inline-suppr test/cfg/qt.cpp
// => // =>
// No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0 // No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0
// //

View File

@ -23,7 +23,7 @@ CPPCHECK="$DIR"../../cppcheck
CFG="$DIR"../../cfg/ CFG="$DIR"../../cfg/
# Cppcheck options # Cppcheck options
CPPCHECK_OPT='--check-library --platform=unix64 --enable=information --enable=style --error-exitcode=-1 --suppress=missingIncludeSystem --inline-suppr --template="{file}:{line}:{severity}:{id}:{message}"' CPPCHECK_OPT='--check-library --platform=unix64 --enable=style --error-exitcode=-1 --suppress=missingIncludeSystem --inline-suppr --template="{file}:{line}:{severity}:{id}:{message}"'
# Compiler settings # Compiler settings
CXX=g++ CXX=g++

View File

@ -2,7 +2,7 @@
// Test library configuration for sqlite3.cfg // Test library configuration for sqlite3.cfg
// //
// Usage: // Usage:
// $ cppcheck --check-library --library=sqlite3 --enable=information --error-exitcode=1 --inline-suppr --suppress=missingIncludeSystem test/cfg/sqlite3.c // $ cppcheck --check-library --enable=style --library=sqlite3 --error-exitcode=1 --suppress=missingIncludeSystem --inline-suppr test/cfg/sqlite3.c
// => // =>
// No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0 // No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0
// //

View File

@ -2,7 +2,7 @@
// Test library configuration for std.cfg // Test library configuration for std.cfg
// //
// Usage: // Usage:
// $ cppcheck --check-library --enable=information --error-exitcode=1 --suppress=missingIncludeSystem --inline-suppr test/cfg/std.c // $ cppcheck --check-library --library=std --enable=style --error-exitcode=1 --suppress=missingIncludeSystem --inline-suppr test/cfg/std.c
// => // =>
// No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0 // No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0
// //

View File

@ -2,7 +2,7 @@
// Test library configuration for std.cfg // Test library configuration for std.cfg
// //
// Usage: // Usage:
// $ cppcheck --check-library --enable=information --error-exitcode=1 --suppress=missingIncludeSystem --inline-suppr test/cfg/std.cpp // $ cppcheck --check-library --library=std --enable=style --error-exitcode=1 --suppress=missingIncludeSystem --inline-suppr test/cfg/std.cpp
// => // =>
// No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0 // No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0
// //

View File

@ -2,7 +2,7 @@
// Test library configuration for windows.cfg // Test library configuration for windows.cfg
// //
// Usage: // Usage:
// $ cppcheck --check-library --library=windows --enable=information --error-exitcode=1 --inline-suppr --suppress=missingIncludeSystem test/cfg/windows.cpp // $ cppcheck --check-library --library=windows --enable=style --error-exitcode=1 --suppress=missingIncludeSystem --inline-suppr test/cfg/windows.cpp
// => // =>
// No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0 // No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0
// //

View File

@ -2,7 +2,7 @@
// Test library configuration for wxwidgets.cfg // Test library configuration for wxwidgets.cfg
// //
// Usage: // Usage:
// $ ./cppcheck --check-library --enable=information --enable=style --error-exitcode=1 --suppress=missingIncludeSystem --inline-suppr '--template="{file}:{line}:{severity}:{id}:{message}"' --inconclusive --library=wxwidgets -f test/cfg/wxwidgets.cpp // $ ./cppcheck --check-library --library=wxwidgets --enable=style --error-exitcode=1 --suppress=missingIncludeSystem --inline-suppr test/cfg/wxwidgets.cpp
// => // =>
// No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0 // No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0
// //

View File

@ -1827,9 +1827,8 @@ private:
} }
void checkLibraryMatchFunctions() { void checkLibraryMatchFunctions() {
const auto settings_old = settings;
settings.checkLibrary = true; settings.checkLibrary = true;
auto severity_old = settings.severity;
settings.severity.enable(Severity::information);
check("void f() {\n" check("void f() {\n"
" lib_func();" " lib_func();"
@ -1951,8 +1950,7 @@ private:
"[test.cpp:5]: (information) --check-library: There is no matching configuration for function auto::push_back()\n", "[test.cpp:5]: (information) --check-library: There is no matching configuration for function auto::push_back()\n",
errout.str()); errout.str());
settings.severity = severity_old; settings = settings_old;
settings.checkLibrary = false;
} }
void checkUseStandardLibrary1() { void checkUseStandardLibrary1() {

View File

@ -239,7 +239,6 @@ private:
// Check for leaks.. // Check for leaks..
CheckLeakAutoVar c; CheckLeakAutoVar c;
settings.checkLibrary = true; settings.checkLibrary = true;
settings.severity.enable(Severity::information);
c.runChecks(&tokenizer, &settings, this); c.runChecks(&tokenizer, &settings, this);
} }
@ -255,7 +254,6 @@ private:
// Check for leaks.. // Check for leaks..
CheckLeakAutoVar c; CheckLeakAutoVar c;
settings_.checkLibrary = true; settings_.checkLibrary = true;
settings_.severity.enable(Severity::information);
c.runChecks(&tokenizer, &settings_, this); c.runChecks(&tokenizer, &settings_, this);
} }
@ -2645,7 +2643,6 @@ private:
// Check for leaks.. // Check for leaks..
CheckLeakAutoVar c; CheckLeakAutoVar c;
settings.checkLibrary = true; settings.checkLibrary = true;
settings.addEnabled("information");
c.runChecks(&tokenizer, &settings, this); c.runChecks(&tokenizer, &settings, this);
} }
@ -2696,7 +2693,6 @@ private:
// Check for leaks.. // Check for leaks..
CheckLeakAutoVar checkLeak; CheckLeakAutoVar checkLeak;
settings.checkLibrary = true; settings.checkLibrary = true;
settings.severity.enable(Severity::information);
checkLeak.runChecks(&tokenizer, &settings, this); checkLeak.runChecks(&tokenizer, &settings, this);
} }

View File

@ -4601,7 +4601,6 @@ private:
void uninitvar_configuration() { void uninitvar_configuration() {
const auto oldSettings = settings; const auto oldSettings = settings;
settings.severity.enable(Severity::information);
settings.checkLibrary = true; settings.checkLibrary = true;
checkUninitVar("int f() {\n" checkUninitVar("int f() {\n"

View File

@ -36,7 +36,6 @@ private:
void run() override { void run() override {
settings.severity.enable(Severity::style); settings.severity.enable(Severity::style);
settings.severity.enable(Severity::information);
settings.checkLibrary = true; settings.checkLibrary = true;
LOAD_LIB_2(settings.library, "std.cfg"); LOAD_LIB_2(settings.library, "std.cfg");