Menu

Upgrade from 2.9 to 2.13 and getting an error code when all issues are fixed (missingIncludeSystem)

2024-04-25
2024-05-01
  • Steve Albright

    Steve Albright - 2024-04-25

    Based on https://sourceforge.net/p/cppcheck/news/2023/06/cppcheck-211/ and the statement "missingInclude" and "missingIncludeSystem" will now cause the "--error-exitcode" to be applied" I'm guessing it started in 2.11?

    We aren't doing any configuration or feeding cppcheck any path or other info, just running it across our clean repo (cmake has not run at all).

    As an example, I have this structure

    ..repo/Services/AService/
    ..repo/Services/AService/Folder1
    ..repo/Services/AService/Folder1/Header1.h
    ..repo/Services/AService/Folder2
    ..repo/Services/AService/Folder2/Header2.h

    Header1.h contains the following include

    include "Folder2/Header2.h"

    which works fine with 2.9. In 2.14 I get

    Process 97 FAILED with return code 1

    If I change the include to

    include "../Folder2/Header2.h"

    I get the expected return code of 0.

    With 2.14 I had to suppress missingIncludeSystem because there are hundreds if not thousands of these issues and we hate relative paths and changing our paths isn't really an option. Is there a way to not set this as an error? I'm not opposed to patching the code (I looked, nothing jumped out at me). I'd like to upgrade but this is a blocker.

    I did change the configuration to use --error-exitcode=0 but I don't want cppcheck to pass when there are other issues that need attention.

    I saw this post https://stackoverflow.com/questions/48504657/cppcheck-returns-error-even-if-no-errors-in-stdout that said it was fixed in an ugprade and I went from 2.13 to 2.14 hoping that might fix it but no luck.

     
  • Steve Albright

    Steve Albright - 2024-04-26

    If I add in this suppression too it seems to work OK

    missingInclude

    I noticed that we were also doing this

    -e "missingInclude"

    so taking that out along with the missingInclude suppression also worked.

     

    Last edit: Steve Albright 2024-04-26
  • Oliver Stöneberg

    I dropped the ball on missingIncludeSystem and it still needs to be adjusted. But too many more important things keep piling up so I never get to it (I have not even filed a ticket about it yet - I think).

     

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.