MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / uninitvar_nonmember

Method uninitvar_nonmember

test/testuninitvar.cpp:7876–7886  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7874 }
7875
7876 void uninitvar_nonmember() {
7877 valueFlowUninit("struct Foo {\n"
7878 " int bar;\n"
7879 "};\n"
7880 "\n"
7881 "int main() {\n"
7882 " Foo* foo;\n"
7883 " foo->bar = 3;\n"
7884 "}");
7885 ASSERT_EQUALS("[test.cpp:7:3]: (error) Uninitialized variable: foo [uninitvar]\n", errout_str());
7886 }
7887
7888 void uninitvarDesignatedInitializers() {
7889 checkUninitVar("struct a { int b; };\n"

Callers

nothing calls this directly

Calls 1

valueFlowUninitFunction · 0.85

Tested by

no test coverage detected