Menu

cppcheck prints the preprocessor defines for file

thomas
2020-03-17
2020-03-19
  • thomas

    thomas - 2020-03-17

    I am running cppcheck on my codebase using a project file. For some files, it just prints out the preprocessor defines and on other files it prints nothing

    Checking …\xxx.cpp ...
    Checking …\xxx.cpp: cplusplus;__GNUC;…..
    20/284 files checked 5% done
    Checking …\yyy.cpp ...
    21/284 files checked 5% done

    What does printing out the preprocessor defines for the file mean? Did it process the file and find some errors or was it unable to process the file?

    Thanks

     
  • Daniel Marjamäki

    If Cppcheck fails to process a file and bails out it will print errors. (syntaxError, internalError, unknownMacro, ...).

    As far as I can tell, the file xxx.cpp was actually preprocessed and checked 2 times and yyy.cpp was preprocessed and checked once. We have "short-circuits" so we don't analyse the same code twice (compared after preprocessing).. but those do not affect what warnings you will see.

     

    Last edit: Daniel Marjamäki 2020-03-19

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.