10 lines
2.3 KiB
HTML
10 lines
2.3 KiB
HTML
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Chapter 6. Suppressions</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.1"><link rel="home" href="index.html" title="Cppcheck 1.44"><link rel="up" href="index.html" title="Cppcheck 1.44"><link rel="prev" href="ch05.html" title="Chapter 5. Reformatting the output"><link rel="next" href="ch07.html" title="Chapter 7. Leaks"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 6. Suppressions</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch05.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="ch07.html">Next</a></td></tr></table><hr></div><div class="chapter" title="Chapter 6. Suppressions"><div class="titlepage"><div><div><h2 class="title"><a name="id2588651"></a>Chapter 6. Suppressions</h2></div></div></div><p>If you want to filter out certain errors you can suppress these.
|
||
First you need to create a suppressions file. The format is:</p><pre class="programlisting">[error id]:[filename]:[line]
|
||
[error id]:[filename2]
|
||
[error id]</pre><p>The <code class="literal">error id</code> is the id that you want to suppress.
|
||
The easiest way to get it is to use the <code class="literal">--xml</code> command
|
||
line flag. Copy and paste the <code class="literal">id</code> string from the xml
|
||
output.</p><p>Here is an example:</p><pre class="programlisting">memleak:file1.cpp
|
||
exceptNew:file1.cpp
|
||
uninitvar</pre><p>You can then use the suppressions file:</p><pre class="programlisting">cppcheck --suppressions suppressions.txt src/</pre><p></p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch05.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="ch07.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 5. Reformatting the output </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 7. Leaks</td></tr></table></div></body></html>
|