-
Notifications
You must be signed in to change notification settings - Fork 1.5k
CppCheck: removed duplicated exception handling from checkInternal()
#8019
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
base: main
Are you sure you want to change the base?
Conversation
|
Best reviewed with whitespaces ignored. |
| // Check normal tokens | ||
| checkNormalTokens(tokenizer, analyzerInformation.get(), currentConfig); | ||
| } catch (const InternalError &e) { | ||
| ErrorMessage errmsg = ErrorMessage::fromInternalError(e, nullptr, file.spath()); |
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.
If we have this InternalError then do we want to abort the loop? Maybe current configuration leads to an InternalError but another configuration is successfully checked?
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 understand what you mean. Could you elaborate a bit?
I also did not change the behavior. It was a try-catch inside another try-catch with the same catch handlers.
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.
This try you removed is inside a for loop that starts at line 1088:
for (const std::string &currCfg : configurations) {
....
try {
code
} catch ...
....
}
if the code would throw an exception then that would have been handled in the loop and the loop could continue to process other configurations..
after your changes it seems to me that the exception is handled below the loop and that the loop is aborted as a consequence.
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.
Ugh. You are right, of course. But it seems we are lacking testing for this. I was curious why none of the test results changed and still would have added a test which triggers it.
The TerminateException is still redundant though.
So I will restore the InternalError and add tests and more documentation. A follow-up will introduce some noexcept (mostly driven by upcoming clang-tidy improvements).
70e0ae5 to
7920029
Compare
|



No description provided.