Skip to content

Commit fe2aee1

Browse files
author
Daniel Marjamäki
committed
Fix ticket cppcheck-opensource#140 (New command line option --auto-dealloc), added documentation
1 parent 017e10e commit fe2aee1

2 files changed

Lines changed: 24 additions & 11 deletions

File tree

man/cppcheck.1.xml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ man(1), man(7), http://www.tldp.org/HOWTO/Man-Page/
4747
<!-- Fill in your name for FIRSTNAME and SURNAME. -->
4848
<!ENTITY dhfirstname "Reijo">
4949
<!ENTITY dhsurname "Tomperi">
50-
<!-- dhusername could also be set to "&firstname; &surname;". -->
50+
<!-- dhusername could also be set to "&firstname; &surname;". -->
5151
<!ENTITY dhusername "&dhfirstname; &dhsurname;">
5252
<!ENTITY dhemail "aggro80@users.sourceforge.net">
5353
<!-- SECTION should be 1-8, maybe w/ subsection other parameters are
@@ -136,24 +136,32 @@ man(1), man(7), http://www.tldp.org/HOWTO/Man-Page/
136136
<term><option>-a</option></term>
137137
<term><option>--all</option></term>
138138
<listitem>
139-
<para>Normally a message is only shown if cppcheck is sure it has
139+
<para>Normally a message is only shown if cppcheck is sure it has
140140
found a bug. When this option is given, all messages are shown.</para>
141141
</listitem>
142142
</varlistentry>
143+
<varlistentry>
144+
<term><option>--auto-dealloc</option></term>
145+
<listitem>
146+
<para>Suppress warnings about classes that have automatic deallocation</para>
147+
<para>The classnames must be provided in plain text - one classname / line - in a .lst file. </para>
148+
<para>This option can be given several times, allowing you to provide several .lst files.</para>
149+
</listitem>
150+
</varlistentry>
143151
<varlistentry>
144152
<term><option>--error-exitcode=[n]</option></term>
145153
<listitem>
146-
<para>If errors are found, integer [n] is returned instead of default 0.
154+
<para>If errors are found, integer [n] is returned instead of default 0.
147155
EXIT_FAILURE is returned if arguments are not valid or if no input files are
148-
provided. Note that your operating system can modify this value, e.g.
156+
provided. Note that your operating system can modify this value, e.g.
149157
256 can become 0.</para>
150158
</listitem>
151159
</varlistentry>
152160
<varlistentry>
153161
<term><option>-f</option></term>
154162
<term><option>--force</option></term>
155163
<listitem>
156-
<para>Force checking of files that have a lot of configurations. Error is printed if such a file is found so there is no reason to use this by
164+
<para>Force checking of files that have a lot of configurations. Error is printed if such a file is found so there is no reason to use this by
157165
default.</para>
158166
</listitem>
159167
</varlistentry>
@@ -167,7 +175,7 @@ default.</para>
167175
<varlistentry>
168176
<term><option>-I [dir]</option></term>
169177
<listitem>
170-
<para>Give include path. Give several -I parameters to give several paths. First given path is checked first. If paths are relative to source
178+
<para>Give include path. Give several -I parameters to give several paths. First given path is checked first. If paths are relative to source
171179
files, this is not needed.</para>
172180
</listitem>
173181
</varlistentry>
@@ -226,5 +234,5 @@ files, this is not needed.</para>
226234
<title>SEE ALSO</title>
227235
<!-- In alpabetical order. -->
228236
<para>Full list of features: http://cppcheck.wiki.sourceforge.net/</para>
229-
</refsect1>
237+
</refsect1>
230238
</refentry>

src/cppcheck.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -235,16 +235,21 @@ std::string CppCheck::parseFromArgs(int argc, const char* const argv[])
235235
oss << "Cppcheck - A tool for static C/C++ code analysis\n"
236236
"\n"
237237
"Syntax:\n"
238-
" cppcheck [--all] [--error-exitcode=[n]] [--force] [--help] \n"
239-
" [-Idir] [-j [jobs]] [--quiet] [--style] \n"
240-
" [--unused-functions] [--verbose] [--version] [--xml] \n"
241-
" [file or path1] [file or path] ...\n"
238+
" cppcheck [--all] [--auto-dealloc file.lst] [--error-exitcode=[n]] [--force]\n"
239+
" [--help] [-Idir] [-j [jobs]] [--quiet] [--style] [--unused-functions]\n"
240+
" [--verbose] [--version] [--xml] [file or path1] [file or path] ...\n"
242241
"\n"
243242
"If path is given instead of filename, *.cpp, *.cxx, *.cc, *.c++ and *.c files\n"
244243
"are checked recursively from given directory.\n\n"
245244
"Options:\n"
246245
" -a, --all Make the checking more sensitive. More bugs are\n"
247246
" detected, but there are also more false positives\n"
247+
" --auto-dealloc file Suppress warnings about classes that have automatic\n"
248+
" deallocation.\n"
249+
" The classnames must be provided in plain text - one\n"
250+
" classname / line - in a .lst file.\n"
251+
" This option can be used several times, allowing you to\n"
252+
" specify several .lst files.\n"
248253
" --error-exitcode=[n] If errors are found, integer [n] is returned instead\n"
249254
" of default 0. EXIT_FAILURE is returned\n"
250255
" if arguments are not valid or if no input files are\n"

0 commit comments

Comments
 (0)