summaryrefslogtreecommitdiff
path: root/tests/usr.bin/xlint/lint1/msg_001.c
blob: a5d9ff87bed104e584648bfd82913176775cf9eb (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
/*	$NetBSD: msg_001.c,v 1.9 2023/03/28 14:44:34 rillig Exp $	*/
# 3 "msg_001.c"

// Test for message: old-style declaration; add 'int' [1]

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

/* expect+1: warning: old-style declaration; add 'int' [1] */
old_style = 1;

int new_style = 1;

/* expect+2: error: old-style declaration; add 'int' [1] */
/* expect+1: warning: static variable 'static_old_style' unused [226] */
static static_old_style = 1;

/* expect+1: warning: static variable 'static_new_style' unused [226] */
static int static_new_style = 1;

/* expect+2: error: old-style declaration; add 'int' [1] */
extern_implicit_int(void)
{
}

/* expect+4: error: old-style declaration; add 'int' [1] */
/* expect+2: warning: static function 'static_implicit_int' unused [236] */
static
static_implicit_int(void)
{
}