Menu

limit the analysis to srcs and headers of a project skipping third party header files?

Kalgary
2021-01-13
2021-01-13
  • Kalgary

    Kalgary - 2021-01-13

    Hi,
    our C++ project is composed by different modules.
    When I call cppcheck on a module source files/headers I get a MissingIncludes warning since module source files include headers from other project modules.

    However, if I include other modules headers with -I these are automatically parsed by cppcheck as well.
    I don't want this, since I don't want to see warnings on other modules code.

    Can I safely Ignore/Suppress this warning ? safely => without false positives?
    Is there a way to get around this?
    Modules are anyway checked one by one.

     

    Last edit: Kalgary 2021-01-13
  • Daniel Marjamäki

    I'd recommend that you use --library=.. if you can. It's better than -I.

    If there is no matching library file then well I would use -I to include the headers . To suppress all warnings in some path use --suppress=*:/path/* . If you have a compilation database or project file then I would suggest that you use that.

     

    Last edit: Daniel Marjamäki 2021-01-13
  • Kalgary

    Kalgary - 2021-01-13

    -I causes cppcheck to check also other modules headers, I would like to limit the analysis to just the module code.
    Is it possible to limit the analysis depth to stop checking files outside the provided path ?
    without mentioning the long exec time....

    --library might be an option but do I have to write a cfg file for my code?

     

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.