Files
codeql/cpp/ql/src/Critical/NotInitialised.qhelp
2018-11-12 15:30:19 +00:00

29 lines
671 B
XML

<!DOCTYPE qhelp PUBLIC
"-//Semmle//qhelp//EN"
"qhelp.dtd">
<qhelp>
<overview>
<p>
This query finds variables that are used before they are initialized. Values of uninitialized variables are
undefined, as not all compilers zero out memory, especially when optimizations are enabled or the compiler
is not compliant with the latest language standards.
</p>
</overview>
<recommendation>
<p>
Initialize the variable before accessing it.
</p>
</recommendation>
<example>
<sample src="NotInitialised.cpp" />
</example>
<references>
<li>C++ reference: <a href="https://en.cppreference.com/book/uninitialized">uninitialized variables</a>.</li>
</references>
</qhelp>