Menu

No header in #include

kr st je
2018-11-19
2018-11-20
  • kr st je

    kr st je - 2018-11-19

    I have a project, which I am scanning with cppcheck. This project uses boost as one dependency. So I added the path to the include dir of boost as a parameter to the call of cppcheck.

    After the scanning, I am getting this output:

    <error msg="No header in #include" verbose="No header in #include" id="preprocessorErrorDirective" severity="error">
    <location line="39" file="C:\\path\\to\\boost\\include\\boost\\config.hpp">
    </location></error>

    I've added the config.php file to this post.

    1) Is this an error in cppcheck?
    2) How can I supress findings coming from boost directory?

     
  • versat

    versat - 2018-11-20

    The boost headers use some preprocessor code which could cause trouble when processed by Cppcheck or more specific by the preprocessor "simplecpp" that Cppcheck uses.
    See for example this ticket: https://github.com/danmar/simplecpp/issues/126
    Some issues were already fixed, but i guess it is not yet possible to parse the boost headers without problems.
    Ideally there would be a library configuration boost.cfg for Cppcheck to avoid false positives and enable better checking of code that uses boost. That would be better than including the boost headers, but requires some work to create the configuration.

    I am not sure if it is currently possible to suppress all findings coming from a specific include path.

     

    Last edit: versat 2018-11-20

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.