-
-
Notifications
You must be signed in to change notification settings - Fork 648
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cppcheck 1.81 warnings #102
Comments
Hi there! So doctest is clean from compiler warnings, but for static code analysis tools - thats much trickier... here are the suppression flags I use on the CI for cppcheck - but different versions of the tool produce different output (and sometimes complains about an unknown suppression flag). Also there are bugs in some versions - like a suppression flag/comment not working... It would be a huge task to make doctest clean for most versions of most static code analysis tools - I've integrated 4-5 tools just to catch bugs in doctest but it was never a goal for the project to be 100% clean for users using static code analysis tools - only for compiler warnings. Also sometimes inline suppressions in the code like My advice would be to try to silence all cppcheck warnings for the header - it should be possible to exclude headers/folders (with any tool). I'll think about this... If it is a big pain for users - I might think of something, so I'm keeping this open |
This one is definitely a bug: [doctest.h:5241]: (warning) %d in format string (no. 1) requires 'int' but the argument type is 'unsigned int'. |
true - fixed it in the dev branch. Anyway I'll be moving to streams (away from format specifiers) in a future internal refactoring |
Our code base cannot have any red Cppcheck warnings, so that is no-go. Luckily, I was able to easily fix the warnings. By the way, Catch2 does not give any Cppcheck warnings. |
I'll be pushing the fix for the format specifier to master soon so I'm closing this. I will look into suppressions again for static code analysis in the future... |
Description
Cppcheck 1.81 reports a bunch of issues. We can't really start using doctest until at least the red (error and warning) Cppcheck warnings have been fixed.
Extra information
The text was updated successfully, but these errors were encountered: