we have enabled search for unused functions, so we have to define all include pathes to 3rd-Party projects. After this we getting a lot of hints, that includes like windows.h are not found (we are using linux). So we tried to disable some pathes, but cppcheck still check this pathes. What we are doing wrong?
The explanation for your problems is that the Cppcheck preprocessor is a bit special. We want to check all configurations. And we don't want to completely re-preprocess the file (read all files over and over again) for each configuration. Therefore the preprocessor first tries to read all files that are included and save it all in memory. Then #ifdefs and #defines etc are handled after that.
We might be able to tweak it so it will skip a #ifdef block that is disabled with -U though.
Hello,
we have enabled search for unused functions, so we have to define all include pathes to 3rd-Party projects. After this we getting a lot of hints, that includes like windows.h are not found (we are using linux). So we tried to disable some pathes, but cppcheck still check this pathes. What we are doing wrong?
Example with CGAL
After this we still get a hint about e.g. LEDA/real.h:
Btw: Maybe --force makes trouble, but we need it, because we have some more defines in our own project
Hi.
strange. I am not sure why. I'll need to investigate why you get that.
Last edit: Daniel Marjamäki 2015-01-09
The explanation for your problems is that the Cppcheck preprocessor is a bit special. We want to check all configurations. And we don't want to completely re-preprocess the file (read all files over and over again) for each configuration. Therefore the preprocessor first tries to read all files that are included and save it all in memory. Then #ifdefs and #defines etc are handled after that.
We might be able to tweak it so it will skip a #ifdef block that is disabled with -U though.
I opened a ticket in our issue tracker so we won't forget this:
http://trac.cppcheck.net/ticket/6427
Last edit: Daniel Marjamäki 2015-01-10