-
Notifications
You must be signed in to change notification settings - Fork 1.9k
C++: Fix a FP in cpp/wrong-number-format-arguments caused by an extraction error #18194
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
C++: Fix a FP in cpp/wrong-number-format-arguments caused by an extraction error #18194
Conversation
|
|
||
| // GOOD [FALSE POSITIVE] | ||
| printf("%d%d" | ||
| UNDEFINED_MACRO, |
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 assume this is an FP, because it neither occurs on the line with the literal, not occurs in any of the arguments?
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.
Yes, so this is one of the FPs we saw on DCA that the current query or fixed query fails to catch. The problem is that the syntax error occurs on line 16, whereas the literal and function call are on line 15, and there is no obvious way to associate the two.
There is no ErrorExpr in the function call, and the extent of the function call is only line 15. So right now, I can't think of a good way to detect this case.
It looks like the frontend's syntax error recovery means dropping all of the expressions until the next ), which is pretty reasonable.
jketema
left a comment
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.
Needs a change note, otherwise, LGTM.
jketema
left a comment
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.
Please remove the commit that changes the date on the change note. This is going to cause a merge conflict with the ongoing 2.20.0 release, which deletes the file.
26eaba7 to
2da3d36
Compare
Commit-by-commit review encouraged. It's a fairly small fix that removes a grand total of one FP on DCA.
Pull Request checklist
All query authors
.qhelp. See the documentation in this repository.Internal query authors only
.ql,.qll, or.qhelpfiles. See the documentation (internal access required).