Hi,
our C++ project is composed by different modules.
When I call cppcheck on a module source files/headers I get a MissingIncludes warning since module source files include headers from other project modules.
However, if I include other modules headers with -I these are automatically parsed by cppcheck as well.
I don't want this, since I don't want to see warnings on other modules code.
Can I safely Ignore/Suppress this warning ? safely => without false positives?
Is there a way to get around this?
Modules are anyway checked one by one.
Last edit: Kalgary 2021-01-13
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'd recommend that you use --library=.. if you can. It's better than -I.
If there is no matching library file then well I would use -I to include the headers . To suppress all warnings in some path use --suppress=*:/path/* . If you have a compilation database or project file then I would suggest that you use that.
Last edit: Daniel Marjamäki 2021-01-13
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
-I causes cppcheck to check also other modules headers, I would like to limit the analysis to just the module code.
Is it possible to limit the analysis depth to stop checking files outside the provided path ?
without mentioning the long exec time....
--library might be an option but do I have to write a cfg file for my code?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
our C++ project is composed by different modules.
When I call cppcheck on a module source files/headers I get a MissingIncludes warning since module source files include headers from other project modules.
However, if I include other modules headers with -I these are automatically parsed by cppcheck as well.
I don't want this, since I don't want to see warnings on other modules code.
Can I safely Ignore/Suppress this warning ? safely => without false positives?
Is there a way to get around this?
Modules are anyway checked one by one.
Last edit: Kalgary 2021-01-13
I'd recommend that you use
--library=..
if you can. It's better than-I
.If there is no matching library file then well I would use
-I
to include the headers . To suppress all warnings in some path use--suppress=*:/path/*
. If you have a compilation database or project file then I would suggest that you use that.Last edit: Daniel Marjamäki 2021-01-13
-I
causes cppcheck to check also other modules headers, I would like to limit the analysis to just the module code.Is it possible to limit the analysis depth to stop checking files outside the provided path ?
without mentioning the long exec time....
--library
might be an option but do I have to write a cfg file for my code?