Try to make Travis happy
This commit is contained in:
parent
82eec11898
commit
4bd9d76a4c
|
@ -550,9 +550,9 @@ void CheckOther::redundantAssignmentError(const Token *tok1, const Token* tok2,
|
||||||
|
|
||||||
void CheckOther::redundantInitializationError(const Token *tok1, const Token* tok2, const std::string& var, bool inconclusive)
|
void CheckOther::redundantInitializationError(const Token *tok1, const Token* tok2, const std::string& var, bool inconclusive)
|
||||||
{
|
{
|
||||||
const std::list<const Token *> callstack = { tok1, tok2 };
|
const std::list<const Token *> callstack = { tok2, tok1 };
|
||||||
reportError(callstack, Severity::style, "redundantInitialization",
|
reportError(callstack, Severity::style, "redundantInitialization",
|
||||||
"$symbol:" + var + "\nRedundant initialization for '$symbol'. The initialized value is never used.",
|
"$symbol:" + var + "\nRedundant initialization for '$symbol'. The initialized value is overwritten before it is read.",
|
||||||
CWE563,
|
CWE563,
|
||||||
inconclusive);
|
inconclusive);
|
||||||
}
|
}
|
||||||
|
|
|
@ -400,9 +400,9 @@ void timet_h(struct timespec* ptp1)
|
||||||
|
|
||||||
void dl(const char* libname, const char* func)
|
void dl(const char* libname, const char* func)
|
||||||
{
|
{
|
||||||
|
// cppcheck-suppress redundantInitialization
|
||||||
void* lib = dlopen(libname, RTLD_NOW);
|
void* lib = dlopen(libname, RTLD_NOW);
|
||||||
// cppcheck-suppress resourceLeak
|
// cppcheck-suppress resourceLeak
|
||||||
// cppcheck-suppress redundantAssignment
|
|
||||||
lib = dlopen(libname, RTLD_LAZY);
|
lib = dlopen(libname, RTLD_LAZY);
|
||||||
const char* funcname;
|
const char* funcname;
|
||||||
// cppcheck-suppress uninitvar
|
// cppcheck-suppress uninitvar
|
||||||
|
|
|
@ -6554,13 +6554,13 @@ private:
|
||||||
" int err = -ENOMEM;\n"
|
" int err = -ENOMEM;\n"
|
||||||
" err = dostuff();\n"
|
" err = dostuff();\n"
|
||||||
"}");
|
"}");
|
||||||
ASSERT_EQUALS("[test.cpp:2] -> [test.cpp:3]: (style) Redundant initialization for 'err'. The initialized value is never used.\n", errout.str());
|
ASSERT_EQUALS("[test.cpp:3] -> [test.cpp:2]: (style) Redundant initialization for 'err'. The initialized value is overwritten before it is read.\n", errout.str());
|
||||||
|
|
||||||
check("void f() {\n"
|
check("void f() {\n"
|
||||||
" struct S s = {1,2,3};\n"
|
" struct S s = {1,2,3};\n"
|
||||||
" s = dostuff();\n"
|
" s = dostuff();\n"
|
||||||
"}");
|
"}");
|
||||||
ASSERT_EQUALS("[test.cpp:2] -> [test.cpp:3]: (style) Redundant initialization for 's'. The initialized value is never used.\n", errout.str());
|
ASSERT_EQUALS("[test.cpp:3] -> [test.cpp:2]: (style) Redundant initialization for 's'. The initialized value is overwritten before it is read.\n", errout.str());
|
||||||
|
|
||||||
check("void f() {\n"
|
check("void f() {\n"
|
||||||
" int *p = NULL;\n"
|
" int *p = NULL;\n"
|
||||||
|
|
Loading…
Reference in New Issue