in my codebase there are some files that can't be analyzed, as shown by
./cppcheck -v --enable=information file.cpp
with error messages like:
information: This file is not analyzed. Cppcheck failed to extract a valid configuration. The tested configurations have these preprocessor errors:
<macro> : <file:line> #error ... [noValidConfiguration]</file:line></macro>
Since this #error isn't thrown in our real build, I guess I've misconfigured something for the analysis (include files, ...).
But still: would it be possible (and reasonable) to skip these #error lines and continue with the analysis anyway, to get at least any kind of analysis result?
Best regards,
Martin
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
But still: would it be possible (and reasonable) to skip these #error lines and continue with the analysis anyway, to get at least any kind of analysis result?
I do not believe it would be reasonable. Better solution is that we either improve Cppcheck so it can extract valid configurations. Or that you somehow ensure cppcheck has a proper configuration. Would it be tricky to provide the build configuration to Cppcheck?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
there are tools that helps you create a compile database from your build scripts.. for instance the "build ear" program might be useful if you build on linux. https://github.com/rizsotto/Bear
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
in my codebase there are some files that can't be analyzed, as shown by
./cppcheck -v --enable=information file.cpp
with error messages like:
information: This file is not analyzed. Cppcheck failed to extract a valid configuration. The tested configurations have these preprocessor errors:
<macro> : <file:line> #error ... [noValidConfiguration]</file:line></macro>
Since this #error isn't thrown in our real build, I guess I've misconfigured something for the analysis (include files, ...).
But still: would it be possible (and reasonable) to skip these #error lines and continue with the analysis anyway, to get at least any kind of analysis result?
Best regards,
Martin
I do not believe it would be reasonable. Better solution is that we either improve Cppcheck so it can extract valid configurations. Or that you somehow ensure cppcheck has a proper configuration. Would it be tricky to provide the build configuration to Cppcheck?
there are tools that helps you create a compile database from your build scripts.. for instance the "build ear" program might be useful if you build on linux.
https://github.com/rizsotto/Bear