Fix clang compiler warning in mathlib.cpp and repair test case for #5895
This commit is contained in:
parent
16352ca674
commit
4d5b463613
|
@ -547,7 +547,6 @@ std::string MathLib::incdec(const std::string & var, const std::string & op)
|
||||||
return MathLib::subtract(var, "1");
|
return MathLib::subtract(var, "1");
|
||||||
|
|
||||||
throw InternalError(0, std::string("Unexpected operation '") + op + "' in MathLib::incdec(). Please report this to Cppcheck developers.");
|
throw InternalError(0, std::string("Unexpected operation '") + op + "' in MathLib::incdec(). Please report this to Cppcheck developers.");
|
||||||
return "";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string MathLib::divide(const std::string &first, const std::string &second)
|
std::string MathLib::divide(const std::string &first, const std::string &second)
|
||||||
|
|
|
@ -7251,10 +7251,8 @@ private:
|
||||||
|
|
||||||
void integerOverflow() { // 5895
|
void integerOverflow() { // 5895
|
||||||
// no signed integer overflow should happen
|
// no signed integer overflow should happen
|
||||||
check("#define A 0x89504e470d0a1a0a\n"
|
check("void f(unsigned long long ull) {\n"
|
||||||
"#define B 0x8a4d4e470d0a1a0a\n"
|
" if (ull == 0x89504e470d0a1a0a || ull == 0x8a4d4e470d0a1a0a) ;\n"
|
||||||
"void f(unsigned long long ull) {\n"
|
|
||||||
" if (ull == A || ull == B);\n"
|
|
||||||
"}\n");
|
"}\n");
|
||||||
ASSERT_EQUALS("", errout.str());
|
ASSERT_EQUALS("", errout.str());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue