Home | History | Annotate | Line # | Download | only in lint1
msg_057.c revision 1.5
      1 /*	$NetBSD: msg_057.c,v 1.5 2022/06/15 20:18:31 rillig Exp $	*/
      2 # 3 "msg_057.c"
      3 
      4 // Test for message: enumeration constant hides parameter: %s [57]
      5 
      6 long
      7 /* expect+3: warning: argument 'red' unused in function 'rgb' [231] */
      8 /* expect+2: warning: argument 'green' unused in function 'rgb' [231] */
      9 /* expect+1: warning: argument 'blue' unused in function 'rgb' [231] */
     10 rgb(int red, int green, int blue)
     11 {
     12 	enum color {
     13 		/* expect+2: warning: enumeration constant hides parameter: red [57] */
     14 		/* expect+1: warning: enumeration constant hides parameter: green [57] */
     15 		red, green, blue
     16 	};
     17 	/* expect-1: warning: enumeration constant hides parameter: blue [57] */
     18 	/*
     19 	 * The warning for 'blue' is at the semicolon since the parser has
     20 	 * already advanced that far, checking for an optional initializer.
     21 	 * As of 2022-06-15, lint does not keep track of the location of each
     22 	 * individual token.
     23 	 */
     24 
     25 	return red + green + blue;
     26 }
     27