Test for %I without width specifier used with printf
This commit is contained in:
parent
438b1ccb91
commit
d6cac72784
|
@ -1875,6 +1875,7 @@ private:
|
|||
" printf(\"%z\", i);\n"
|
||||
" printf(\"%t\", i);\n"
|
||||
" printf(\"%L\", i);\n"
|
||||
" printf(\"%I\", i);\n"
|
||||
"}");
|
||||
ASSERT_EQUALS("[test.cpp:2]: (warning) 'h' in format string (no. 1) is a length modifier and cannot be used without a conversion specifier.\n"
|
||||
"[test.cpp:3]: (warning) 'hh' in format string (no. 1) is a length modifier and cannot be used without a conversion specifier.\n"
|
||||
|
@ -1883,7 +1884,8 @@ private:
|
|||
"[test.cpp:6]: (warning) 'j' in format string (no. 1) is a length modifier and cannot be used without a conversion specifier.\n"
|
||||
"[test.cpp:7]: (warning) 'z' in format string (no. 1) is a length modifier and cannot be used without a conversion specifier.\n"
|
||||
"[test.cpp:8]: (warning) 't' in format string (no. 1) is a length modifier and cannot be used without a conversion specifier.\n"
|
||||
"[test.cpp:9]: (warning) 'L' in format string (no. 1) is a length modifier and cannot be used without a conversion specifier.\n", errout.str());
|
||||
"[test.cpp:9]: (warning) 'L' in format string (no. 1) is a length modifier and cannot be used without a conversion specifier.\n"
|
||||
"[test.cpp:10]: (warning) 'I' in format string (no. 1) is a length modifier and cannot be used without a conversion specifier.\n", errout.str());
|
||||
|
||||
check("void foo(unsigned int i) {\n"
|
||||
" printf(\"%hd\", i);\n"
|
||||
|
|
Loading…
Reference in New Issue