Home | History | Annotate | Line # | Download | only in lint1
decl_struct_c90.c revision 1.2
      1 /*	$NetBSD: decl_struct_c90.c,v 1.2 2021/07/15 20:05:49 rillig Exp $	*/
      2 # 3 "decl_struct_c90.c"
      3 
      4 /*
      5  * Test declaration of struct types, in C90 without any GNU extensions.
      6  */
      7 
      8 /* lint1-flags: -sw */
      9 
     10 /*
     11  * All of K&R, C90, C99 require that a struct member declaration is
     12  * terminated with a semicolon.
     13  *
     14  * Before cgram.y 1.328 from 2021-07-15, lint allowed the missing semicolon
     15  * in non-C90 mode, no idea why.
     16  */
     17 struct missing_semicolon {
     18 	int member
     19 };
     20 /* expect-1: error: syntax error '}' [249] */
     21 /* expect+1: error: cannot recover from previous errors [224] */
     22