-
Notifications
You must be signed in to change notification settings - Fork 37
Use cppcheck right #654
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
Use cppcheck right #654
Changes from all commits
ea64b22
790b5b2
c4760f2
1ec1d93
1025bff
64a760e
25e4183
aa955b8
e75e4e9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| missingIncludeSystem | ||
|
|
||
| noExplicitConstructor | ||
|
|
||
| unknownMacro | ||
|
|
||
| shadowFunction | ||
|
|
||
| unusedVariable | ||
|
|
||
| localMutex | ||
|
|
||
| unmatchedSuppression | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Consider the implications of suppressing unmatched suppression warnings. The
Consider implementing a process to periodically review all suppression rules, especially focusing on those that don't match any warnings. This will help maintain a clean and effective set of suppression rules. You could add a comment in this file to remind about periodic reviews:
Comment on lines
+1
to
+13
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Enhance file structure and documentation for better maintainability. While the individual suppression rules have been addressed, the overall structure and documentation of this file could be improved:
Consider restructuring the file as follows: This structure provides context for each suppression and groups related rules together, making the file easier to maintain and understand. |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Consider the implications of using these suppression rules and document their rationale.
The addition of these suppression rules for Cppcheck is noted. While suppression rules can be useful for managing false positives or known issues, they should be used judiciously to avoid hiding potential problems. Here are some considerations:
missingIncludeSystem: Generally safe, but ensure all necessary system headers are available on the target system.noExplicitConstructor: Be cautious as this might hide issues with implicit conversions.unknownMacro: Ensure all macros are properly defined to avoid suppressing genuine issues.shadowFunction: Use carefully as function shadowing can lead to confusion and bugs.unusedVariable: Monitor to prevent code clutter.localMutex: Be aware that this might hide potential threading issues.Consider the following recommendations:
Example documentation format:
This documentation will help maintain transparency about the suppressed warnings and facilitate future code maintenance.