11 lines
2.8 KiB
HTML
11 lines
2.8 KiB
HTML
|
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Chapter 5. Reformatting the output</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="ch04.html" title="Chapter 4. XML output"><link rel="next" href="ch06.html" title="Chapter 6. Suppressions"></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 5. Reformatting the output</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch04.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="ch06.html">Next</a></td></tr></table><hr></div><div class="chapter" title="Chapter 5. Reformatting the output"><div class="titlepage"><div><div><h2 class="title"><a name="id2588572"></a>Chapter 5. Reformatting the output</h2></div></div></div><p>If you want to reformat the output so it looks different you can use
|
|||
|
templates.</p><p>To get Visual Studio compatible output you can use "--template
|
|||
|
vs":</p><pre class="programlisting">cppcheck --template vs gui/test.cpp</pre><p>This output will look like this:</p><pre class="programlisting">Checking gui/test.cpp...
|
|||
|
gui/test.cpp(31): error: Memory leak: b
|
|||
|
gui/test.cpp(16): error: Mismatching allocation and deallocation: k</pre><p>To get gcc compatible output you can use "--template gcc":</p><pre class="programlisting">cppcheck --template gcc gui/test.cpp</pre><p>The output will look like this:</p><pre class="programlisting">Checking gui/test.cpp...
|
|||
|
gui/test.cpp:31: error: Memory leak: b
|
|||
|
gui/test.cpp:16: error: Mismatching allocation and deallocation: k</pre><p>You can write your own pattern (for example a comma-separated
|
|||
|
format):</p><pre class="programlisting">cppcheck --template "{file},{line},{severity},{id},{message}" gui/test.cpp</pre><p>The output will look like this:</p><pre class="programlisting">Checking gui/test.cpp...
|
|||
|
gui/test.cpp,31,error,memleak,Memory leak: b
|
|||
|
gui/test.cpp,16,error,mismatchAllocDealloc,Mismatching allocation and deallocation: k</pre><p></p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch04.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="ch06.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 4. XML output </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 6. Suppressions</td></tr></table></div></body></html>
|