Menu

Cppcheck error reporting (replace GCC)

Trampas
2018-04-16
2018-04-17
  • Trampas

    Trampas - 2018-04-16

    This might be a newbie stupid question, but I would like to replace my compiler gcc.exe with a call to cppcheck. Ideally the error output of ccpcheck would match the same format as GCC errors such that the IDE can parse correctly. I am not sure if this is possible already or not?

    Thanks
    Trampas

     
  • versat

    versat - 2018-04-17

    Hmm, i have not tried that. If the IDE uses only parameters that Cppcheck also knows (like -I, -D) or if you can customize it then it maybe works.
    You can add the parameter "--template=gcc" to the Cppcheck call so the error format is like the one from GCC, then the IDE should be able to parse it.
    Maybe you can try that and report how it worked :)

     
  • Trampas

    Trampas - 2018-04-17

    I tried to get my IDE, eclipse, to work and could not as I could not turn off some compiler command line options.

    One of the reasons I wanted to do this is that it would be nice to setup with MISRA rules and basically do a build for cppcheck.

    I know there is a plugin for ecplise for cppcheck but currently it does not parse errors correctly in eclipse and does not allow plugins.

    Another option might be write a script (python/bash) that removes the GCC command line options and calls cppcheck, or maybe better would be to modify cppcheck with a configuration file where you could configure command line parameters to ignore.

     

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.