Home | History | Annotate | Line # | Download | only in lint1
msg_045.c revision 1.5
      1 /*	$NetBSD: msg_045.c,v 1.5 2022/06/19 12:14:34 rillig Exp $	*/
      2 # 3 "msg_045.c"
      3 
      4 /* Test for message: base type is really '%s %s' [45] */
      5 
      6 /* lint1-flags: -tw */
      7 
      8 struct counter {
      9 	int value;
     10 };
     11 
     12 function()
     13 {
     14 	/* expect+4: warning: base type is really 'struct counter' [45] */
     15 	/* expect+3: warning: declaration introduces new type in ANSI C: union counter [44] */
     16 	/* expect+2: error: 'counter' has incomplete type 'incomplete union counter' [31] */
     17 	/* expect+1: warning: union 'counter' never defined [234] */
     18 	union counter counter;
     19 	/* expect+1: warning: illegal use of member 'value' [102] */
     20 	counter.value++;
     21 }
     22