Skip to content

Commit ccaecc2

Browse files
Update testio.cpp
1 parent 7f779ed commit ccaecc2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/testio.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2186,6 +2186,12 @@ class TestIO : public TestFixture {
21862186
" scanf(\"%i\", \"abc\" + 1);\n"
21872187
"}\n");
21882188
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());
21892195
}
21902196

21912197
void testPrintfArgument() {

0 commit comments

Comments
 (0)