parent
c294b15360
commit
461565c50a
|
@ -67,6 +67,7 @@ public:
|
||||||
checkOther.checkDuplicateExpression();
|
checkOther.checkDuplicateExpression();
|
||||||
checkOther.checkUnreachableCode();
|
checkOther.checkUnreachableCode();
|
||||||
checkOther.checkSuspiciousSemicolon();
|
checkOther.checkSuspiciousSemicolon();
|
||||||
|
checkOther.checkWrongPrintfScanfArguments();
|
||||||
|
|
||||||
// information checks
|
// information checks
|
||||||
checkOther.checkVariableScope();
|
checkOther.checkVariableScope();
|
||||||
|
@ -91,7 +92,6 @@ public:
|
||||||
checkOther.checkCCTypeFunctions();
|
checkOther.checkCCTypeFunctions();
|
||||||
checkOther.checkFflushOnInputStream();
|
checkOther.checkFflushOnInputStream();
|
||||||
checkOther.invalidScanf();
|
checkOther.invalidScanf();
|
||||||
checkOther.checkWrongPrintfScanfArguments();
|
|
||||||
|
|
||||||
checkOther.checkCoutCerrMisusage();
|
checkOther.checkCoutCerrMisusage();
|
||||||
checkOther.checkIncorrectLogicOperator();
|
checkOther.checkIncorrectLogicOperator();
|
||||||
|
|
|
@ -2027,9 +2027,9 @@ private:
|
||||||
" fclose(file);\n"
|
" fclose(file);\n"
|
||||||
" return b;\n"
|
" return b;\n"
|
||||||
"}");
|
"}");
|
||||||
ASSERT_EQUALS("[test.cpp:6]: (warning) scanf without field width limits can crash with huge input data\n"
|
ASSERT_EQUALS("[test.cpp:8]: (warning) fscanf format string has 0 parameters but 1 are given\n"
|
||||||
"[test.cpp:7]: (warning) scanf without field width limits can crash with huge input data\n"
|
"[test.cpp:6]: (warning) scanf without field width limits can crash with huge input data\n"
|
||||||
"[test.cpp:8]: (warning) fscanf format string has 0 parameters but 1 are given\n", errout.str());
|
"[test.cpp:7]: (warning) scanf without field width limits can crash with huge input data\n", errout.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void testScanf2() {
|
void testScanf2() {
|
||||||
|
@ -2044,9 +2044,9 @@ private:
|
||||||
" fclose(file);\n"
|
" fclose(file);\n"
|
||||||
" return b;\n"
|
" return b;\n"
|
||||||
"}");
|
"}");
|
||||||
ASSERT_EQUALS("[test.cpp:6]: (warning) scanf without field width limits can crash with huge input data\n"
|
ASSERT_EQUALS("[test.cpp:8]: (warning) fscanf format string has 0 parameters but 1 are given\n"
|
||||||
"[test.cpp:7]: (warning) scanf without field width limits can crash with huge input data\n"
|
"[test.cpp:6]: (warning) scanf without field width limits can crash with huge input data\n"
|
||||||
"[test.cpp:8]: (warning) fscanf format string has 0 parameters but 1 are given\n", errout.str());
|
"[test.cpp:7]: (warning) scanf without field width limits can crash with huge input data\n", errout.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void testScanf3() {
|
void testScanf3() {
|
||||||
|
@ -2212,6 +2212,7 @@ private:
|
||||||
" printf(\"%G\", bp);\n"
|
" printf(\"%G\", bp);\n"
|
||||||
" printf(\"%f\", d);\n"
|
" printf(\"%f\", d);\n"
|
||||||
" printf(\"%f\", b);\n"
|
" printf(\"%f\", b);\n"
|
||||||
|
" printf(\"%f\", (float)cpi);\n"
|
||||||
"}");
|
"}");
|
||||||
ASSERT_EQUALS("[test.cpp:3]: (warning) %e in format string (no. 1) requires a floating point number given in the argument list\n"
|
ASSERT_EQUALS("[test.cpp:3]: (warning) %e in format string (no. 1) requires a floating point number given in the argument list\n"
|
||||||
"[test.cpp:4]: (warning) %E in format string (no. 1) requires a floating point number given in the argument list\n"
|
"[test.cpp:4]: (warning) %E in format string (no. 1) requires a floating point number given in the argument list\n"
|
||||||
|
|
Loading…
Reference in New Issue