summaryrefslogtreecommitdiff
path: root/tests/usr.bin/xlint/lint1/msg_021.c
blob: d9f323ef300e8968eac1f10d6c1dc871ce780a82 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*	$NetBSD: msg_021.c,v 1.5 2023/07/07 19:45:22 rillig Exp $	*/
# 3 "msg_021.c"

// Test for message: redeclaration of formal parameter '%s' [21]

/* See also message 237, which has the same text. */

/* lint1-extra-flags: -X 351 */

/*ARGSUSED*/
void
/* expect+1: error: redeclaration of formal parameter 'parameter' [21] */
old_style_with_duplicate_parameter(parameter, parameter)
    int parameter;
{
	/* expect-1: warning: type of argument 'parameter' defaults to 'int' [32] */
}

void
old_style_with_duplicate_parameter_declaration(parameter)
    int parameter;
    /* expect+1: error: redeclaration of formal parameter 'parameter' [237] */
    int parameter;
{
}

void old_style_with_local_variable(parameter)
    int parameter;
{
	/* expect+1: error: redeclaration of 'parameter' [27] */
	int parameter;
}

/*ARGSUSED*/
void
/* expect+1: error: redeclaration of formal parameter 'param' [237] */
prototype_with_duplicate_parameter(int param, int param)
{

}

void
prototype_with_local_variable(int parameter)
{
	/* expect+1: error: redeclaration of 'parameter' [27] */
	int parameter;
}