Home | History | Annotate | Line # | Download | only in lint1
msg_277.c revision 1.4
      1 /*	$NetBSD: msg_277.c,v 1.4 2021/02/27 18:01:29 rillig Exp $	*/
      2 # 3 "msg_277.c"
      3 
      4 // Test for message: initialization of '%s' with '%s' [277]
      5 
      6 /* lint1-extra-flags: -e */
      7 
      8 enum E {
      9 	E1
     10 };
     11 
     12 void sink_enum(enum E);
     13 void sink_int(int);
     14 
     15 void
     16 example(enum E e, int i)
     17 {
     18 	enum E e2 = e;
     19 	enum E e3 = { i };	/* expect: 277 */
     20 	int i2 = { e };		/* expect: 277 */
     21 	int i3 = i;
     22 
     23 	sink_enum(e2);
     24 	sink_enum(e3);
     25 	sink_int(i2);
     26 	sink_int(i3);
     27 }
     28