C++: Exclusion rules for system macros #6723
Draft
Conversation
Unwanted results were reported for our JPL Rule 24 queries. Including system headers with complex macros could lead to unpredictable alerts from these rules.
geoffw0
reviewed
Sep 21, 2021
| * | ||
| * If the system macro is invoked through a non-system macro, then this | ||
| * predicate does not hold. That's a limitation of how macros are represented | ||
| * in the database. |
Could you share an example? (I'd have thought between getAnExpandedElement() and MacroInvocation.getParentInvocation() we can work this out, I could be wrong)
I've pushed a commit that removes the claim about db limitations.
geoffw0
reviewed
Sep 21, 2021
Approved, because neither of my comments needs to block merging this.
A review comment pointed out that this claim might not be correct.
MathiasVP
approved these changes
Sep 30, 2021
|
I've converted this PR to a draft because we're trying to find out which customers (and which teams) would be affected by this change. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Unwanted results were reported for our JPL Rule 24 queries. Inclusion of system headers with complex macros could lead to unpredictable alerts from these rules.
Fixes #6522.
It's hard to write unit tests for these changes, like it was in #5085, because there are no system headers in qltests. I tested manually on a vim/vim snapshot and found some examples:
MultipleStmtsPerLine.qlchange removes this alert forFD_ISSET.MultipleVarDeclsPerLine.qlchange removes this alert forFD_ZERO.The text was updated successfully, but these errors were encountered: