Skip to content

Commit 5edcade

Browse files
committed
SwitchNotWellFormed: Address compiler compat
Declarations cannot appear just after case labels.
1 parent 74a5d7a commit 5edcade

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
| test.c:4:3:10:3 | switch (...) ... | $@ statement not well formed because this $@ block uses a statement that is not allowed. | test.c:4:3:10:3 | switch (...) ... | Switch | test.c:5:3:5:9 | case ...: | case |
2-
| test.c:13:3:20:3 | switch (...) ... | $@ statement not well formed because this $@ block uses a statement that is not allowed. | test.c:13:3:20:3 | switch (...) ... | Switch | test.c:14:3:14:10 | case ...: | case |
3-
| test.c:25:3:30:3 | switch (...) ... | $@ statement not well formed because this $@ block uses a statement that is not allowed. | test.c:25:3:30:3 | switch (...) ... | Switch | test.c:26:3:26:9 | case ...: | case |
1+
| test.c:4:3:11:3 | switch (...) ... | $@ statement not well formed because this $@ block uses a statement that is not allowed. | test.c:4:3:11:3 | switch (...) ... | Switch | test.c:5:3:5:9 | case ...: | case |
2+
| test.c:14:3:21:3 | switch (...) ... | $@ statement not well formed because this $@ block uses a statement that is not allowed. | test.c:14:3:21:3 | switch (...) ... | Switch | test.c:15:3:15:10 | case ...: | case |
3+
| test.c:26:3:31:3 | switch (...) ... | $@ statement not well formed because this $@ block uses a statement that is not allowed. | test.c:26:3:31:3 | switch (...) ... | Switch | test.c:27:3:27:9 | case ...: | case |

c/common/test/rules/switchnotwellformed/test.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ void f1();
33
void f2(int p1) {
44
switch (p1) {
55
case 1:
6+
f1();
67
int y = p1; // NON_COMPLIANT - `DeclStmt` whose parent
78
// statement is the switch body
89
f1();

0 commit comments

Comments
 (0)