Skip to content

Commit ff57bb4

Browse files
committed
DCL41-C: Fix test compiler syntax issue
Cases are labels, and cannot be before declarations.
1 parent ed8ccda commit ff57bb4

File tree

1 file changed

+2
-0
lines changed
  • c/cert/test/rules/DCL41-C

1 file changed

+2
-0
lines changed

c/cert/test/rules/DCL41-C/test.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ void f1(int expr) {
2323
void f2(int expr) {
2424
switch (expr) {
2525
case 0:
26+
0; // Note: required because a "case" is a label, and not permitted on a
27+
// declaration, so we need a no-op statement
2628
int i = 4; // COMPLIANT
2729
case 1:
2830
i = 6; // COMPLIANT

0 commit comments

Comments
 (0)