Menu

#error lines stopping analyses

Martin
2021-02-12
2021-02-15
  • Martin

    Martin - 2021-02-12

    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

     
  • Daniel Marjamäki

    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?

     
    • Daniel Marjamäki

      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

       

Log in to post a comment.