doc: updated docs about -D command line flag
This commit is contained in:
parent
14b27f97fa
commit
5fe2a56b41
|
@ -532,7 +532,7 @@ bool CppCheck::parseFromArgs(int argc, const char* const argv[])
|
|||
oss << "Cppcheck - A tool for static C/C++ code analysis\n"
|
||||
"\n"
|
||||
"Syntax:\n"
|
||||
" cppcheck [--append=file] [--enable=<id>] [--error-exitcode=[n]]\n"
|
||||
" cppcheck [--append=file] [-D<ID>] [--enable=<id>] [--error-exitcode=[n]]\n"
|
||||
" [--exitcode-suppressions file] [--file-list=file.txt] [--force]\n"
|
||||
" [--help] [-Idir] [--inline-suppr] [-j [jobs]] [--quiet] [--style]\n"
|
||||
" [--suppressions file.txt] [--verbose] [--version] [--xml]\n"
|
||||
|
@ -543,6 +543,10 @@ bool CppCheck::parseFromArgs(int argc, const char* const argv[])
|
|||
"Options:\n"
|
||||
" --append=file This allows you to provide information about\n"
|
||||
" functions by providing an implementation for these.\n"
|
||||
" -D<ID> By default Cppcheck checks all configurations.\n"
|
||||
" Use -D to limit the checking. When -D is used the\n"
|
||||
" checking is limited to the given configuration.\n"
|
||||
" Example: -DDEBUG=1 -D__cplusplus\n"
|
||||
" --enable=id Enable specific checks. The available ids are:\n"
|
||||
" * all - enable all checks\n"
|
||||
" * exceptNew - exception safety when using new\n"
|
||||
|
|
|
@ -155,6 +155,23 @@ Checking path/file2.cpp...
|
|||
</section>
|
||||
</chapter>
|
||||
|
||||
<chapter>
|
||||
<title>Preprocessor configurations</title>
|
||||
|
||||
<para>By default Cppcheck will check all preprocessor configurations
|
||||
(except those that has #error in them). This is the recommended
|
||||
behaviour.</para>
|
||||
|
||||
<para>But if you want to manually limit the checking you can do so with
|
||||
<literal>-D</literal>.</para>
|
||||
|
||||
<para>For example, if you want to limit the checking so the only
|
||||
configuration to check should be "DEBUG=1;__cplusplus" then something like
|
||||
this can be used:</para>
|
||||
|
||||
<programlisting>cppcheck -DDEBUG=1 -D__cplusplus path</programlisting>
|
||||
</chapter>
|
||||
|
||||
<chapter>
|
||||
<title>XML output</title>
|
||||
|
||||
|
|
Loading…
Reference in New Issue