File tree Expand file tree Collapse file tree 1 file changed +19
-19
lines changed
c/misra/src/rules/RULE-14-3 Expand file tree Collapse file tree 1 file changed +19
-19
lines changed Original file line number Diff line number Diff line change @@ -33,24 +33,24 @@ where
3333 )
3434 ) and
3535 message = "Controlling expression in if statement has invariant value."
36+ or
37+ exists ( Loop loop |
38+ loop .getControllingExpr ( ) = expr and
39+ (
40+ conditionAlwaysFalse ( expr )
41+ or
42+ conditionAlwaysTrue ( expr )
43+ )
44+ ) and
45+ message = "Controlling expression in loop statement has invariant value."
46+ or
47+ exists ( SwitchStmt switch |
48+ switch .getControllingExpr ( ) = expr and
49+ (
50+ conditionAlwaysFalse ( expr ) or
51+ conditionAlwaysTrue ( expr )
52+ )
53+ ) and
54+ message = "Controlling expression in switch statement has invariant value."
3655 )
37- or
38- exists ( Loop loop |
39- loop .getControllingExpr ( ) = expr and
40- (
41- conditionAlwaysFalse ( expr )
42- or
43- conditionAlwaysTrue ( expr )
44- )
45- ) and
46- message = "Controlling expression in loop statement has invariant value."
47- or
48- exists ( SwitchStmt switch |
49- switch .getControllingExpr ( ) = expr and
50- (
51- conditionAlwaysFalse ( expr ) or
52- conditionAlwaysTrue ( expr )
53- )
54- ) and
55- message = "Controlling expression in switch statement has invariant value."
5656select expr , message
You can’t perform that action at this time.
0 commit comments