-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Fix #13797 FN nullPointer with negated if-condition (regression) #8172
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
test/testnullpointer.cpp
Outdated
| " return s;\n" | ||
| "}\n", dinit(CheckOptions, $.inconclusive = true)); | ||
| ASSERT_EQUALS("", errout_str()); | ||
| TODO_ASSERT_EQUALS("", |
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.
We already warn without the negation: if (r) ..., so I'm not sure if this should even be a TODO.
In the original ticket, g() was a library function, so maybe we could extend the configuration options there.
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.
Could you file a ticket about this with the todoassert keyword? Otherwise these things tend to rot.
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.
Turned into an ASSERT. I think we intend to warn if there are unknown functions that just might modify their arguments (hence inconclusive). As said above, #9827 is probably a library issue.
|
Those are some nice true positives. |
|
|
This seems to fix multiple tickets, see https://trac.cppcheck.net/search?q=d30f42e0da85ef23cd5efb46225a8be29b90b5f8 |



No description provided.