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 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).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
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
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).