A7-1-7
: Exclude expression statements in macros
#629
Labels
Difficulty-Low
A false positive or false negative report which is expected to take <1 day effort to address
false positive/false negative
An issue related to observed false positives or false negatives.
Impact-Medium
Standard-AUTOSAR
Affected rules
A7-1-7
Description
Macro expansion can cause multiple expressions and statements to appear at the same location. We exclude macro expanded declarations, I think we should do the same for expression statements.
Reviewing the query, I think this is actually caused by a bracketing issue:
There's also an interesting thing happening here with locations - as we might expect such macro expansions to by the
not l1 = l2
line in the select clause:The reason this doesn't exclude this case is that when we expand the macro, we may provide different locations for the expressions and statements within, if we can associate them with a specific macro parameter.
Example
The text was updated successfully, but these errors were encountered: