Improve test coverage for %zx, %zu used with printf
This commit is contained in:
parent
a260b5157a
commit
a748ced9da
|
@ -2054,6 +2054,12 @@ private:
|
|||
ASSERT_EQUALS("[test.cpp:2]: (warning) %zx in format string (no. 1) requires 'size_t' but the argument type is 'signed int'.\n"
|
||||
"[test.cpp:2]: (warning) %zu in format string (no. 2) requires 'size_t' but the argument type is 'long double'.\n", errout.str());
|
||||
|
||||
check("void foo(unsigned int ui, long double ld) {\n"
|
||||
" printf(\"%zu %zx\", ui, ld);\n"
|
||||
"}");
|
||||
ASSERT_EQUALS("[test.cpp:2]: (warning) %zu in format string (no. 1) requires 'size_t' but the argument type is 'unsigned int'.\n"
|
||||
"[test.cpp:2]: (warning) %zx in format string (no. 2) requires 'size_t' but the argument type is 'long double'.\n", errout.str());
|
||||
|
||||
check("void foo(int i, long double ld) {\n"
|
||||
" printf(\"%tx %tu\", i, ld);\n"
|
||||
"}");
|
||||
|
|
Loading…
Reference in New Issue