Skip to content

Commit 16601af

Browse files
committed
Rule 2.6: Address compiler syntax errors
Labels cannot be before declarations, only before expressions or statements.
1 parent 5b7118e commit 16601af

File tree

1 file changed

+3
-3
lines changed
  • c/misra/test/rules/RULE-2-6

1 file changed

+3
-3
lines changed

c/misra/test/rules/RULE-2-6/test.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
void test1(int p1) {
22
dead_label_1: // NON_COMPLIANT
33
live_label_1: // COMPLIANT
4-
int x = 0;
4+
p1 + 1;
55
live_label_2: // COMPLIANT
66
dead_label_2: // NON_COMPLIANT
7-
int y = 0;
7+
p1 + 2;
88
dead_label_3: // NON_COMPLIANT
9-
int z = 0;
9+
p1 + 3;
1010

1111
if (p1 > 1) {
1212
goto live_label_1;

0 commit comments

Comments
 (0)