-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Partial fix #11892 (Safety: status message when checkers are skipped) #5368
Conversation
cli/cppcheckexecutor.cpp
Outdated
@@ -67,6 +67,18 @@ | |||
#include <windows.h> | |||
#endif | |||
|
|||
static const std::set<std::string> criticalErrors{ |
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.
What about introducing a fatal
severity instead?
Should also include missingInclude
as incomplete code will also lead to incomplete analysis.
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.
I do not agree about adding missingInclude
. We will always have false negatives. Our parser is far from perfect. I will never promise that we have "complete" analysis.
I would normally include all local headers when I check some code.
More include paths are not always better. It can have a significant performance penalty. System headers should not be included in general. And I have the feeling that if the header code is very complex it can be better to leave it out.
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.
For the error ids I listed, the analysis is stopped. The checkers are not executed at all.
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.
About adding a fatal
severity. In theory it sounds good to me. It's just that it's one more thing that will break plugins and scripts.
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.
Just off the top of my head (it's based on something I considered for another improvement).
- add
Severity::fatal
and change the errors in question - add
Settings::fatalErrors
(default:false
) - and command-line option
--fatal-errors
- add support for
fatal
to--enable
/--disable
- if that option is not set treat them simply as
error
- always enable that option for the GUI analysis
This way you can opt-in/opt-out and it fits in the existing frameworks.
This should be configurable as it will most certainly break existing installations which have suppressed these errors (for a long time possibly). |
I believe that if such errors are suppressed then my changes will not change the behavior of cppcheck. |
@firewave After your questions I am not sure if this is the right approach. At least not in the command line. Thanks! |
hmm.. but I guess the GUI changes makes sense at least to start with.. |
@firewave maybe it would make sense to treat missingInclude, varid0, checkLibrary, debug warnings, etc differently if the check level is "exhaustive"? |
We can only include I thought about the same. Making |
Work in progress to be more visible when there are critical errors, and no checking is executed in a file.