diff --git a/cfg/std.cfg b/cfg/std.cfg index 3d2aed7ce..007b2f879 100644 --- a/cfg/std.cfg +++ b/cfg/std.cfg @@ -45,16 +45,21 @@ - - false - + + false + - - - false - + + + false + - + + + false + + 0- + false 0-255 false 0-255 false 0-255 diff --git a/test/testnullpointer.cpp b/test/testnullpointer.cpp index eec9fda93..1e1ecf532 100644 --- a/test/testnullpointer.cpp +++ b/test/testnullpointer.cpp @@ -2435,6 +2435,9 @@ private: check("void f(char * p){ strchr (p,c);if(!p){}}"); ASSERT_EQUALS(errp,errout.str()); + check("void f(char * p){ putchar (*p);if(!p){}}"); + ASSERT_EQUALS(errp,errout.str()); + check("void f(char * p){ strdup (p);if(!p){}}"); ASSERT_EQUALS(errp,errout.str()); diff --git a/test/testuninitvar.cpp b/test/testuninitvar.cpp index 690064e1a..f9ddf60f7 100644 --- a/test/testuninitvar.cpp +++ b/test/testuninitvar.cpp @@ -3643,6 +3643,17 @@ private: "}"); ASSERT_EQUALS("", errout.str()); + // putchar + checkUninitVar("void f() {\n" + " char *c;" + " putchar (*c);\n" + "}"); + ASSERT_EQUALS("[test.cpp:2]: (error) Uninitialized variable: c\n", errout.str()); + + checkUninitVar("void f( char *c) {\n" + " putchar (*c);\n" + "}"); + ASSERT_EQUALS("", errout.str()); } };