2022-10-01 12:42:40 +03:00
|
|
|
/* $NetBSD: msg_030.c,v 1.6 2022/10/01 09:42:40 rillig Exp $ */
|
2021-01-02 13:22:42 +03:00
|
|
|
# 3 "msg_030.c"
|
|
|
|
|
2022-06-11 15:23:59 +03:00
|
|
|
/* Test for message: redeclaration of '%s'; ANSI C requires static [30] */
|
2021-01-02 13:22:42 +03:00
|
|
|
|
2022-04-06 02:09:19 +03:00
|
|
|
/* lint1-flags: -sw */
|
|
|
|
|
2022-10-01 12:42:40 +03:00
|
|
|
/* expect+1: error: old-style declaration; add 'int' [1] */
|
2022-04-06 02:09:19 +03:00
|
|
|
static a;
|
2022-06-11 15:23:59 +03:00
|
|
|
/* expect+1: warning: redeclaration of 'a'; ANSI C requires static [30] */
|
2022-04-06 02:09:19 +03:00
|
|
|
int a;
|
|
|
|
|
2022-10-01 12:42:40 +03:00
|
|
|
/* expect+1: error: old-style declaration; add 'int' [1] */
|
2022-04-06 02:09:19 +03:00
|
|
|
static b;
|
2022-06-11 15:23:59 +03:00
|
|
|
/* expect+1: warning: redeclaration of 'b'; ANSI C requires static [30] */
|
2022-04-06 02:09:19 +03:00
|
|
|
int b = 1;
|
|
|
|
|
2022-10-01 12:42:40 +03:00
|
|
|
/* expect+1: error: old-style declaration; add 'int' [1] */
|
2022-04-06 02:09:19 +03:00
|
|
|
static c = 1;
|
2022-06-11 15:23:59 +03:00
|
|
|
/* expect+1: warning: redeclaration of 'c'; ANSI C requires static [30] */
|
2022-04-06 02:09:19 +03:00
|
|
|
int c;
|
|
|
|
|
|
|
|
void
|
|
|
|
use_variables(void)
|
|
|
|
{
|
|
|
|
c = a + b + c;
|
|
|
|
}
|