diff --git a/test/testother.cpp b/test/testother.cpp index 584205787..83e89076a 100644 --- a/test/testother.cpp +++ b/test/testother.cpp @@ -6966,6 +6966,14 @@ private: "}"); ASSERT_EQUALS("[test.cpp:3]: (warning) Storing getchar() return value in char variable and then comparing with EOF.\n", errout.str()); + check("void f() {\n" + " unsigned char c;\n" + " while( EOF != ( c = getchar() ) )\n" + " {\n" + " }\n" + "}"); + ASSERT_EQUALS("[test.cpp:3]: (warning) Storing getchar() return value in char variable and then comparing with EOF.\n", errout.str()); + check("void f() {\n" " int i; i = getchar();\n" " while( i != EOF)\n" diff --git a/test/testsizeof.cpp b/test/testsizeof.cpp index 769a0d507..743cbb3d5 100644 --- a/test/testsizeof.cpp +++ b/test/testsizeof.cpp @@ -746,9 +746,11 @@ private: " void* p = malloc(10);\n" " int* p2 = p + 4;\n" " int* p3 = p - 1;\n" + " int* p4 = 1 + p;\n" "}"); ASSERT_EQUALS("[test.cpp:3]: (portability) 'p' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined.\n" - "[test.cpp:4]: (portability) 'p' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined.\n", errout.str()); + "[test.cpp:4]: (portability) 'p' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined.\n" + "[test.cpp:5]: (portability) 'p' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined.\n", errout.str()); check("void f() {\n" " void* p1 = malloc(10);\n"