We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6e8b70e commit 243ae08Copy full SHA for 243ae08
1 file changed
test/testuninitvar.cpp
@@ -2164,6 +2164,13 @@ class TestUninitVar : public TestFixture {
2164
" return p;\n"
2165
"}\n");
2166
ASSERT_EQUALS("[test.cpp:5:9]: (error) Memory is allocated but not initialized: *p [uninitdata]\n", errout_str());
2167
+
2168
+ checkUninitVar("char* f(size_t nBytes, size_t nAlign) {\n" // #14485
2169
+ " char* p = reinterpret_cast<char*>(malloc(nBytes));\n"
2170
+ " if ((uintptr_t)p % nAlign != 0) {}\n"
2171
+ " return p;\n"
2172
+ "}\n");
2173
+ ASSERT_EQUALS("", errout_str());
2174
}
2175
2176
// class / struct..
0 commit comments