Home | History | Annotate | Line # | Download | only in lint1
msg_186.c revision 1.6
      1 /*	$NetBSD: msg_186.c,v 1.6 2023/03/28 14:44:35 rillig Exp $	*/
      2 # 3 "msg_186.c"
      3 
      4 /* Test for message: bit-field initialization is illegal in traditional C [186] */
      5 
      6 /* lint1-flags: -tw -X 351 */
      7 
      8 struct bit_field {
      9 	unsigned one: 1;
     10 	unsigned three: 3;
     11 	unsigned two: 2;
     12 };
     13 
     14 struct bit_field bit_field = {
     15 	1,
     16 	/* expect+1: warning: bit-field initialization is illegal in traditional C [186] */
     17 	3.0,
     18 	2
     19 };
     20 /* XXX: The message is misleading.  Initialization using integers is ok. */
     21