We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7f779ed commit ccaecc2Copy full SHA for ccaecc2
test/testio.cpp
@@ -2186,6 +2186,12 @@ class TestIO : public TestFixture {
2186
" scanf(\"%i\", \"abc\" + 1);\n"
2187
"}\n");
2188
ASSERT_EQUALS("[test.cpp:2]: (warning) %i in format string (no. 1) requires 'int *' but the argument type is 'const char *'.\n", errout_str());
2189
+
2190
+ check("struct S { unsigned char a[1]; };" // #14302
2191
+ "void f(S s) {\n"
2192
+ " scanf(\"%hhu\", s.a);\n"
2193
+ "}\n");
2194
+ ASSERT_EQUALS("", errout_str());
2195
}
2196
2197
void testPrintfArgument() {
0 commit comments