1 /* $NetBSD: msg_021.c,v 1.4 2022/06/20 21:13:36 rillig Exp $ */ 2 # 3 "msg_021.c" 3 4 // Test for message: redeclaration of formal parameter '%s' [21] 5 6 /* See also message 237, which has the same text. */ 7 8 /*ARGSUSED*/ 9 void 10 /* expect+1: error: redeclaration of formal parameter 'parameter' [21] */ 11 old_style_with_duplicate_parameter(parameter, parameter) 12 int parameter; 13 { 14 /* expect-1: warning: type of argument 'parameter' defaults to 'int' [32] */ 15 } 16 17 void 18 old_style_with_duplicate_parameter_declaration(parameter) 19 int parameter; 20 /* expect+1: error: redeclaration of formal parameter 'parameter' [237] */ 21 int parameter; 22 { 23 } 24 25 void old_style_with_local_variable(parameter) 26 int parameter; 27 { 28 /* expect+1: error: redeclaration of 'parameter' [27] */ 29 int parameter; 30 } 31 32 /*ARGSUSED*/ 33 void 34 /* expect+1: error: redeclaration of formal parameter 'param' [237] */ 35 prototype_with_duplicate_parameter(int param, int param) 36 { 37 38 } 39 40 void 41 prototype_with_local_variable(int parameter) 42 { 43 /* expect+1: error: redeclaration of 'parameter' [27] */ 44 int parameter; 45 } 46