msg_021.c revision 1.5
1/*	$NetBSD: msg_021.c,v 1.5 2023/07/07 19:45:22 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/* lint1-extra-flags: -X 351 */
9
10/*ARGSUSED*/
11void
12/* expect+1: error: redeclaration of formal parameter 'parameter' [21] */
13old_style_with_duplicate_parameter(parameter, parameter)
14    int parameter;
15{
16	/* expect-1: warning: type of argument 'parameter' defaults to 'int' [32] */
17}
18
19void
20old_style_with_duplicate_parameter_declaration(parameter)
21    int parameter;
22    /* expect+1: error: redeclaration of formal parameter 'parameter' [237] */
23    int parameter;
24{
25}
26
27void old_style_with_local_variable(parameter)
28    int parameter;
29{
30	/* expect+1: error: redeclaration of 'parameter' [27] */
31	int parameter;
32}
33
34/*ARGSUSED*/
35void
36/* expect+1: error: redeclaration of formal parameter 'param' [237] */
37prototype_with_duplicate_parameter(int param, int param)
38{
39
40}
41
42void
43prototype_with_local_variable(int parameter)
44{
45	/* expect+1: error: redeclaration of 'parameter' [27] */
46	int parameter;
47}
48