Home | History | Annotate | Line # | Download | only in lint1
msg_323.c revision 1.3
      1 /*	$NetBSD: msg_323.c,v 1.3 2021/10/09 21:25:39 rillig Exp $	*/
      2 # 3 "msg_323.c"
      3 
      4 // Test for message: continue in 'do ... while (0)' loop [323]
      5 void println(const char *);
      6 
      7 void
      8 example(const char *p)
      9 {
     10 	do {
     11 		switch (*p) {
     12 		case 'a':
     13 			continue;	/* leaves the 'do while 0' */
     14 		case 'b':
     15 			break;		/* leaves the 'switch' */
     16 		}
     17 		println("b");
     18 	/* XXX: Is that really worth an error? */
     19 	/* expect+1: error: continue in 'do ... while (0)' loop [323] */
     20 	} while (0);
     21 }
     22