Fix clang compiler warning in mathlib.cpp and repair test case for #5895

This commit is contained in:
Alexander Mai 2014-06-07 13:16:02 +02:00
parent 16352ca674
commit 4d5b463613
2 changed files with 2 additions and 5 deletions

View File

@ -547,7 +547,6 @@ std::string MathLib::incdec(const std::string & var, const std::string & op)
return MathLib::subtract(var, "1");
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)

View File

@ -7251,10 +7251,8 @@ private:
void integerOverflow() { // 5895
// no signed integer overflow should happen
check("#define A 0x89504e470d0a1a0a\n"
"#define B 0x8a4d4e470d0a1a0a\n"
"void f(unsigned long long ull) {\n"
" if (ull == A || ull == B);\n"
check("void f(unsigned long long ull) {\n"
" if (ull == 0x89504e470d0a1a0a || ull == 0x8a4d4e470d0a1a0a) ;\n"
"}\n");
ASSERT_EQUALS("", errout.str());
}