Menu

Difference between commandline tool and cppcheck GUI

2016-04-07
2016-04-09
  • Jonas Medin

    Jonas Medin - 2016-04-07

    // Codestart test.cpp

    void setup() {
    // put your setup code here, to run once:
    }

    void loop() {
    // put your main code here, to run repeatedly:
    }
    // Codeend

    Checking this code with commandline tool (cppcheck.exe --enable=all test.cpp) gives the following correct printout:
    Checking test.cpp...
    [test.cpp:6]: (style) The function 'loop' is never used.
    [test.cpp:2]: (style) The function 'setup' is never used.

    But running the same test.cpp in the GUI will only say 'No errors found'.
    Due to documentation, all tests shall be enabled in the GUI.

     
  • Daniel Marjamäki

    Currently the unused-functions check does not work when checking with multiple threads. Try -j2 on the command line and those warnings disappear.

    I would like that was fixed. But I don't think it will be fixed anytime soon..

    so is there some way to document it better that it is inactive?

     
  • Daniel Marjamäki

    Basically.. whole program analysis does not work well with multiple threads.

     

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.