I call cppcheck on our own files in our source base. However, some source files include header files from third party libraries, say from ./lib/some_library/
. These are automatically parsed by cppcheck as well.
I don't want this, since I don't want to see warnings on third party code. Is there a way to get around this?
The difference with how can i tell cppcheck to skip a header file is that this post explicitly asks for skipping an entire directory, not just an individual header file.
Another possibility would be to use suppressions via a file (see manual chapter 7 "Listing suppressions in a file") or via commandline.
Your suppressions.txt could be
*:/path/to/your/thirdpartylibs/*
Which would exclude all errors from that path. The syntax is
[error id]:[filename]:[line]
with wildcard support for *
(multiple characters) and ?
(single character).
The call to cppcheck would then be
cppcheck --suppressions-list=suppressions.txt .
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With