Menu

Errors not reported when using project file

Yann
2021-11-22
2021-11-27
  • Yann

    Yann - 2021-11-22

    Hi I created up an .cppcheck xml from my setup using a script .
    I activated CERT , MISRA analysis, and use CPPCheck GUI
    I was surprised there's wasn't so much entries in the report : too good to be true.
    Then, I tried to use Analyze/directory... from the GUI and I get a LOT more entries !
    And most cannot be related to defines...
    It's seems really strange to me 🤨

     
  • Daniel Marjamäki

    yes it sounds strange. hard to say what the reason is.

    can you reproduce the behavior for a single file also? Using Analyze/file.. and then the .cppcheck can specify a file instead of a path to check.

    if you create a .cppcheck file that does not have any defines then the analysis should be similar to Analyze/directory..

    can you show the .cppcheck file?

     
  • Yann

    Yann - 2021-11-25

    Hi I have the feeling it's linked to an #ifdef block that have a syntax error. In this case could it stop the processing of the remaining part of the file ?

     
    • Daniel Marjamäki

      if you get some syntax error output then yes this will stop all the analysis immediately.

      if you don't get the output then it shouldn't stop.

      I assume that when you provide include paths and defines then you get a lot fewer warnings. If you use -E (cppcheck -E -DDEF file.c) option on a file can you see if the preprocessor output contains some important parts of your 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.