Manual: Described file0 attribute in XML output and the relationship between <not-null/> and <not-uninit/>
This commit is contained in:
parent
e2a04c508c
commit
dec839ea79
|
@ -362,7 +362,7 @@ cppcheck -DA --force file.c</programlisting>
|
|||
<errors>
|
||||
<error id="someError" severity="error" msg="short error text"
|
||||
verbose="long error text" inconclusive="true" cwe="312">
|
||||
<location file="file.c" line="1"/>
|
||||
<location file0="file.c" file="file.h" line="1"/>
|
||||
</error>
|
||||
</errors>
|
||||
</results></programlisting>
|
||||
|
@ -448,6 +448,14 @@ cppcheck -DA --force file.c</programlisting>
|
|||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><sgmltag class="attribute">file0</sgmltag></term>
|
||||
|
||||
<listitem>
|
||||
<para>name of the source file (optional)</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><sgmltag class="attribute">line</sgmltag></term>
|
||||
|
||||
|
@ -836,6 +844,9 @@ Checking uninit.c...</programlisting>
|
|||
Checking uninit.c...
|
||||
[uninit.c:5]: (error) Uninitialized variable: buffer2</programlisting>
|
||||
|
||||
<para>Note that this implies for pointers that the memory they point
|
||||
at has to be initialized, too.</para>
|
||||
|
||||
<para>Here is the minimal <literal>windows.cfg</literal>:</para>
|
||||
|
||||
<para><programlisting><?xml version="1.0"?>
|
||||
|
@ -868,13 +879,17 @@ Checking uninit.c...
|
|||
<programlisting># cppcheck null.c
|
||||
Checking null.c...</programlisting>
|
||||
|
||||
<para>If you provide a windows configuration file then
|
||||
<para>If you provide a configuration file then
|
||||
<literal>Cppcheck</literal> detects the bug:</para>
|
||||
|
||||
<programlisting>cppcheck --library=windows.cfg null.c
|
||||
Checking null.c...
|
||||
[null.c:3]: (error) Null pointer dereference</programlisting>
|
||||
|
||||
<para>Note that this implies <literal><not-uninit></literal> as
|
||||
far as values are concerned. Uninitialized memory might still be passed
|
||||
do the function.</para>
|
||||
|
||||
<para>Here is a minimal <literal>windows.cfg</literal> file:</para>
|
||||
|
||||
<programlisting><?xml version="1.0"?>
|
||||
|
|
Loading…
Reference in New Issue