Skip to content

Commit e4151cf

Browse files
committed
RULE-21-12: Exclude nested macro invocations
Do not report macro invocations inside other macro invocations where the parent macro invocation is also for a macro inside fenv.h.
1 parent 5ce2983 commit e4151cf

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

c/misra/src/rules/RULE-21-12/ExceptionHandlingFeaturesOfFenvhUsed.ql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ where
4545
exists(FPExceptionHandlingMacro m |
4646
call = m.getAnInvocation() and
4747
name = m.getName() and
48-
kind = "macro"
48+
kind = "macro" and
49+
// Exclude macro invocations expanded from other macro invocations from macros in fenv.h.
50+
not call.(MacroInvocation).getParentInvocation().getMacro().getFile().getBaseName() = "fenv.h"
4951
)
5052
)
5153
select call, "Call to banned " + kind + " " + name + "."

0 commit comments

Comments
 (0)