Library configuration
When external libraries are used, such as WinAPI, POSIX, gtk, Qt, etc, Cppcheck
has no information about functions, types, or macros contained in those libraries.
Cppcheck then fails to detect various problems in the code, or might even abort
the analysis. But this can be fixed by using the appropriate configuration files.
Cppcheck already contains configurations for several libraries. They can be
loaded as described below. Note that the configuration for the standard libraries
of C and C++, std.cfg, is always loaded by cppcheck. If you create or update a
configuration file for a popular library, we would appreciate if you supplied it to
the cppcheck project.
Using a .cfg file
To use a .cfg file shipped with cppcheck, pass the
--library=<lib>
option. The
table below shows the currently existing libraries: | .cfg file | Library | Comment |
| ————- | ————- | ————- | | avr.cfg | | | bento4.cfg | Bento4 | | boost.cfg
| Boost| | bsd.cfg | BSD | | cairo.cfg | cairo | | cppcheck-lib.cfg | Cppcheck | Used
in selfcheck of the Cppcheck code base | cppunit.cfg | CppUnit | | dpdk.cfg |
| | embedded_sql.cfg | | | emscripten.cfg | | | ginac.cfg | | | gnu.cfg | GNU | |
googletest.cfg | GoogleTest | | gtk.cfg | GTK | | icu.cfg | | | kde.cfg | KDE | |
libcerror.cfg | libcerror | | libcurl.cfg | libcurl | | libsigc++.cfg | libsigc++ | |
lua.cfg | | | mfc.cfg | MFC | | microsoft_atl.cfg | ATL | | microsoft_sal.cfg | SAL
annotations | | microsoft_unittest.cfg | CppUnitTest | | motif.cfg | | | nspr.cfg |
| | ntl.cfg | | | opencv2.cfg | OpenCV | | opengl.cfg | OpenGL | | openmp.cfg |
OpenMP | | openssl.cfg | OpenSSL | | pcre.cfg | PCRE | | posix.cfg | POSIX | |
python.cfg | | | qt.cfg | Qt | | ruby.cfg | | | sdl.cfg | | | sfml.cfg | | | sqlite3.cfg |
SQLite | | std.cfg | C/C++ standard library | Loaded by default | tinyxml2.cfg
| TinyXML-2 | | vcl.cfg | | | windows.cfg | Win32 API | | wxsqlite3.cfg | | |
wxsvg.cfg | | | wxwidgets.cfg | wxWidgets | | zephyr.cfg | | | zlib.cfg | zlib |
29