Conversation
| #include <windows.h> | ||
| #endif | ||
|
|
||
| static const std::set<std::string> criticalErrors{ |
There was a problem hiding this comment.
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.
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.
For the error ids I listed, the analysis is stopped. The checkers are not executed at all.
There was a problem hiding this comment.
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.
Just off the top of my head (it's based on something I considered for another improvement).
- add
Severity::fataland change the errors in question - add
Settings::fatalErrors(default:false) - and command-line option
--fatal-errors - add support for
fatalto--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.