Menu

Exclude libaries for cppcheck

2017-07-10
2017-07-10
  • Markus Runkel

    Markus Runkel - 2017-07-10

    Hello,

    in a project I use the Boost library. If I now use Cppcheck with a .json-file, he also checks the Boost library, as it is part of the include path. Is there a possibility to exclude the libraries.
    I use Cppcheck on a Ubuntu 32-bit in the terminal.

    The command:

    cppcheck --enable=all --dump --force --project=compile_commands.json
    
     

    Last edit: Markus Runkel 2017-07-10
  • Daniel Marjamäki

    that is unfortunate. currently there is no builtin solution.

    on ubuntu a quick and simple solution is to use sed to remove the boost include paths. If the path is "/usr/include" you can use:

    sed -i 's|-I/usr/include ||' compile_commands.json
    

    I am not sure how to do it best if we want to add some builtin function in Cppcheck.

     
  • Daniel Marjamäki

    I created a ticket:
    http://trac.cppcheck.net/ticket/8118

    maybe it's possible to create a builtin function.

     

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.