Manual: Added a getting started chapter for the GUI
This commit is contained in:
parent
117892e5b2
commit
7cd920f9d4
Binary file not shown.
After Width: | Height: | Size: 20 KiB |
Binary file not shown.
After Width: | Height: | Size: 36 KiB |
Binary file not shown.
After Width: | Height: | Size: 33 KiB |
Binary file not shown.
After Width: | Height: | Size: 35 KiB |
Binary file not shown.
After Width: | Height: | Size: 103 KiB |
|
@ -5,7 +5,7 @@
|
||||||
<bookinfo>
|
<bookinfo>
|
||||||
<title>Cppcheck 1.81 dev</title>
|
<title>Cppcheck 1.81 dev</title>
|
||||||
|
|
||||||
<date>2017-03-14</date>
|
<date>2017-08-12</date>
|
||||||
</bookinfo>
|
</bookinfo>
|
||||||
|
|
||||||
<chapter>
|
<chapter>
|
||||||
|
@ -47,7 +47,98 @@
|
||||||
</chapter>
|
</chapter>
|
||||||
|
|
||||||
<chapter>
|
<chapter>
|
||||||
<title>Getting started</title>
|
<title>Getting started (GUI)</title>
|
||||||
|
|
||||||
|
<para>Start the GUI.</para>
|
||||||
|
|
||||||
|
<section>
|
||||||
|
<title>New Project</title>
|
||||||
|
|
||||||
|
<para>It is not required but creating a new project file is a good first
|
||||||
|
step. You do so through <literal>File</literal> and <literal>New project
|
||||||
|
file.</literal></para>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section>
|
||||||
|
<title>New Project - Paths and Defines</title>
|
||||||
|
|
||||||
|
<para>What kind of project do you have? If it is a Visual Studio project
|
||||||
|
or if you can generate a compile database (cmake/qbs/etc), then you can
|
||||||
|
import the project.</para>
|
||||||
|
|
||||||
|
<para>Otherwise you can configure the paths and defines manually. In
|
||||||
|
this screenshot below, a Visual Studio project file is imported:</para>
|
||||||
|
|
||||||
|
<mediaobject>
|
||||||
|
<imageobject>
|
||||||
|
<imagedata fileref="images/gui-newproject-pathsanddefines.png"/>
|
||||||
|
</imageobject>
|
||||||
|
</mediaobject>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section>
|
||||||
|
<title>New Project - Project</title>
|
||||||
|
|
||||||
|
<para>In the Project tab it is highly recommended that a
|
||||||
|
<literal>Cppcheck build dir</literal> is configured. This will be used
|
||||||
|
by Cppcheck to store various analysis information. It gives you whole
|
||||||
|
program analysis, incremental analysis, statistics, etc. Each project
|
||||||
|
should have its own unique build dir. In the screenshot below the build
|
||||||
|
dir is configured as <literal>cppcheck-build-dir</literal>. The path is
|
||||||
|
relative to the project file.</para>
|
||||||
|
|
||||||
|
<para>You should also choose all the libraries that you use. In the
|
||||||
|
screenshot below the microsoft_sal and windows libraries are selected.
|
||||||
|
You can read more about libraries in this manual.</para>
|
||||||
|
|
||||||
|
<mediaobject>
|
||||||
|
<imageobject>
|
||||||
|
<imagedata fileref="images/gui-newproject-project.png"/>
|
||||||
|
</imageobject>
|
||||||
|
</mediaobject>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section>
|
||||||
|
<title>New Project - Addons</title>
|
||||||
|
|
||||||
|
<para>We skip the <literal>Exclude</literal> and
|
||||||
|
<literal>Suppressions</literal> tabs now, they can be used later to
|
||||||
|
tweak the results.</para>
|
||||||
|
|
||||||
|
<para>In the Addons tab you can add extra analysis. The addons require
|
||||||
|
python.</para>
|
||||||
|
|
||||||
|
<mediaobject>
|
||||||
|
<imageobject>
|
||||||
|
<imagedata fileref="images/gui-newproject-addons.png"/>
|
||||||
|
</imageobject>
|
||||||
|
</mediaobject>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section>
|
||||||
|
<title>Analyze</title>
|
||||||
|
|
||||||
|
<para>Click the <literal>OK</literal> button in the dialog. Analysis
|
||||||
|
will start immediately.</para>
|
||||||
|
|
||||||
|
<mediaobject>
|
||||||
|
<imageobject>
|
||||||
|
<imagedata fileref="images/gui-results.png"/>
|
||||||
|
</imageobject>
|
||||||
|
</mediaobject>
|
||||||
|
|
||||||
|
<para>All warnings are activated and therefore it is pretty noisy. There
|
||||||
|
are likely various warnings that you don't care about. You can fix that
|
||||||
|
easily, right click on messages and choose <literal>Hide</literal> or
|
||||||
|
<literal>Suppress</literal>. Hiding messages is not permanent, they will
|
||||||
|
be shown after next analysis. Suppressing messages is permanent,
|
||||||
|
suppressed ids are stored in the project file and those will not be
|
||||||
|
shown again.</para>
|
||||||
|
</section>
|
||||||
|
</chapter>
|
||||||
|
|
||||||
|
<chapter>
|
||||||
|
<title>Getting started (command line)</title>
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
<title>First test</title>
|
<title>First test</title>
|
||||||
|
@ -128,11 +219,11 @@ Checking path/file2.cpp...
|
||||||
|
|
||||||
<programlisting>cppcheck -isrc/c src</programlisting>
|
<programlisting>cppcheck -isrc/c src</programlisting>
|
||||||
|
|
||||||
<para>This option does not currently work with the
|
<para>This option does not currently work with the <parameter
|
||||||
<parameter class="command">--project</parameter> option and is only
|
class="command">--project</parameter> option and is only valid when
|
||||||
valid when supplying an input directory.To ignore multiple directories
|
supplying an input directory.To ignore multiple directories supply the
|
||||||
supply the <parameter class="command">-i</parameter> multiple times.
|
<parameter class="command">-i</parameter> multiple times. The following
|
||||||
The following command ignores both the src/b and src/c directories.</para>
|
command ignores both the src/b and src/c directories.</para>
|
||||||
|
|
||||||
<programlisting>cppcheck -isrc/b -isrc/c</programlisting>
|
<programlisting>cppcheck -isrc/b -isrc/c</programlisting>
|
||||||
</section>
|
</section>
|
||||||
|
@ -918,10 +1009,11 @@ Checking pen1.c...
|
||||||
<para>The arguments a function takes can be specified by
|
<para>The arguments a function takes can be specified by
|
||||||
<literal><arg></literal> tags. Each of them takes the number of
|
<literal><arg></literal> tags. Each of them takes the number of
|
||||||
the argument (starting from 1) in the <literal>nr</literal> attribute,
|
the argument (starting from 1) in the <literal>nr</literal> attribute,
|
||||||
<literal>nr="any"</literal> for arbitrary arguments, or <literal>nr="variadic"</literal> for variadic arguments.
|
<literal>nr="any"</literal> for arbitrary arguments, or
|
||||||
Optional arguments can be specified by providing a default value:
|
<literal>nr="variadic"</literal> for variadic arguments. Optional
|
||||||
<literal>default="value"</literal>. The specifications for individual arguments override
|
arguments can be specified by providing a default value:
|
||||||
this setting.</para>
|
<literal>default="value"</literal>. The specifications for individual
|
||||||
|
arguments override this setting.</para>
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
<title>Not bool</title>
|
<title>Not bool</title>
|
||||||
|
|
Loading…
Reference in New Issue