Skip to content

Commit 7221dc4

Browse files
committed
Rule 14.3: Improve alert message
1 parent 3cd6908 commit 7221dc4

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

c/misra/src/rules/RULE-14-3/ControllingExprInvariant.ql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ where
3131
)
3232
)
3333
) and
34-
message = "Controlling expression in if statement has invariant value."
34+
message = "Controlling expression in if statement has an invariant value."
3535
or
3636
exists(Loop loop |
3737
loop.getControllingExpr() = expr and
@@ -47,7 +47,7 @@ where
4747
not expr instanceof Literal
4848
)
4949
) and
50-
message = "Controlling expression in loop statement has invariant value."
50+
message = "Controlling expression in loop statement has an invariant value."
5151
or
5252
exists(SwitchStmt switch |
5353
switch.getControllingExpr() = expr and
@@ -56,7 +56,7 @@ where
5656
conditionAlwaysTrue(expr)
5757
)
5858
) and
59-
message = "Controlling expression in switch statement has invariant value."
59+
message = "Controlling expression in switch statement has an invariant value."
6060
or
6161
exists(ConditionalExpr conditional |
6262
conditional.getCondition() = expr and
@@ -65,7 +65,7 @@ where
6565
conditionAlwaysTrue(expr)
6666
)
6767
) and
68-
message = "Controlling expression in conditional statement has invariant value."
68+
message = "Controlling expression in conditional statement has an invariant value."
6969
) and
7070
// Exclude cases where the controlling expressions is affected by a macro, because they can appear
7171
// invariant in a particular invocation, but be variant between invocations.
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
| test.c:4:7:4:11 | ... > ... | Controlling expression in if statement has invariant value. |
2-
| test.c:15:10:15:16 | ... > ... | Controlling expression in loop statement has invariant value. |
3-
| test.c:16:9:16:13 | ... > ... | Controlling expression in if statement has invariant value. |
4-
| test.c:20:20:20:24 | ... < ... | Controlling expression in loop statement has invariant value. |
5-
| test.c:27:10:27:14 | ... < ... | Controlling expression in loop statement has invariant value. |
6-
| test.c:37:3:37:6 | 1 | Controlling expression in conditional statement has invariant value. |
7-
| test.c:38:3:38:3 | 1 | Controlling expression in conditional statement has invariant value. |
1+
| test.c:4:7:4:11 | ... > ... | Controlling expression in if statement has an invariant value. |
2+
| test.c:15:10:15:16 | ... > ... | Controlling expression in loop statement has an invariant value. |
3+
| test.c:16:9:16:13 | ... > ... | Controlling expression in if statement has an invariant value. |
4+
| test.c:20:20:20:24 | ... < ... | Controlling expression in loop statement has an invariant value. |
5+
| test.c:27:10:27:14 | ... < ... | Controlling expression in loop statement has an invariant value. |
6+
| test.c:37:3:37:6 | 1 | Controlling expression in conditional statement has an invariant value. |
7+
| test.c:38:3:38:3 | 1 | Controlling expression in conditional statement has an invariant value. |

0 commit comments

Comments
 (0)