add documentation for --suppress= option
This commit is contained in:
parent
22210e0255
commit
ec4e0c8bf5
|
@ -671,11 +671,12 @@ void CmdLineParser::PrintHelp()
|
|||
" --rule-file=<file> Use given rule file. For more information, see: \n"
|
||||
" https://sourceforge.net/projects/cppcheck/files/Articles/\n"
|
||||
" -s, --style Deprecated, use --enable=style\n"
|
||||
" --suppressions-list=<file>\n"
|
||||
" Suppress warnings listed in the file. Filename and line\n"
|
||||
" are optional in the suppression file. The format of the\n"
|
||||
" single line in the suppression file is:\n"
|
||||
" --suppress=<spec> Suppress a specific warning. The format of <spec> is:\n"
|
||||
" [error id]:[filename]:[line]\n"
|
||||
" The [filename] and [line] are optional.\n"
|
||||
" --suppressions-list=<file>\n"
|
||||
" Suppress warnings listed in the file. Each suppression\n"
|
||||
" is in the same format as <spec> above.\n"
|
||||
" --template '<text>' Format the error messages. E.g.\n"
|
||||
" '{file}:{line},{severity},{id},{message}' or\n"
|
||||
" '{file}({line}):({severity}) {message}'\n"
|
||||
|
|
|
@ -120,6 +120,7 @@ man(1), man(7), http://www.tldp.org/HOWTO/Man-Page/
|
|||
<arg choice="opt"><option>--rule=<rule></option></arg>
|
||||
<arg choice="opt"><option>--rule-file=<file></option></arg>
|
||||
<arg choice="opt"><option>--style</option></arg>
|
||||
<arg choice="opt"><option>--suppress=<spec></option></arg>
|
||||
<arg choice="opt"><option>--suppressions-list=<file></option></arg>
|
||||
<arg choice="opt"><option>--template '<text>'</option></arg>
|
||||
<arg choice="opt"><option>--verbose</option></arg>
|
||||
|
@ -303,12 +304,19 @@ Directory name is matched to all parts of the path.</para>
|
|||
<para>Deprecated, use --enable=style</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><option>--suppress=<spec></option></term>
|
||||
<listitem>
|
||||
<para>Suppress a specific warning. The format of <spec> is: [error id]:[filename]:[line].
|
||||
The [filename] and [line] are optional.
|
||||
[filename] may contain the wildcard characters * or ?.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><option>--suppressions-list=<file></option></term>
|
||||
<listitem>
|
||||
<para>Suppress warnings listed in the file. Filename and line are optional. The format of the single line in file is: [error id]:[filename]:[line].
|
||||
You can use --template or --xml to see the error id.
|
||||
The filename may contain the wildcard characters * or ?.</para>
|
||||
<para>Suppress warnings listed in the file.
|
||||
Each suppression is in the format of <spec> above.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
|
|
|
@ -374,7 +374,8 @@ gui/test.cpp,16,error,mismatchAllocDealloc,Mismatching allocation and deallocati
|
|||
<title>Suppressions</title>
|
||||
|
||||
<para>If you want to filter out certain errors you can suppress these.
|
||||
First you need to create a suppressions file. The format is:</para>
|
||||
The <literal>--suppress=</literal> command line option is used to specify
|
||||
suppressions on the command line. The format is one of:</para>
|
||||
|
||||
<programlisting>[error id]:[filename]:[line]
|
||||
[error id]:[filename2]
|
||||
|
@ -389,6 +390,11 @@ gui/test.cpp,16,error,mismatchAllocDealloc,Mismatching allocation and deallocati
|
|||
* or ?, which match any sequence of characters or any single character
|
||||
respectively.</para>
|
||||
|
||||
<programlisting>cppcheck --suppress=memleak:file1.cpp src/</programlisting>
|
||||
|
||||
<para>If you have more than a couple of suppressions, create a suppressions
|
||||
file with one line per suppression as above.</para>
|
||||
|
||||
<para>Here is an example:</para>
|
||||
|
||||
<programlisting>memleak:file1.cpp
|
||||
|
|
Loading…
Reference in New Issue