mirror of
https://github.com/github/codeql.git
synced 2026-01-07 19:50:22 +01:00
29 lines
671 B
XML
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>
|