This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/38047] New: -Wredundant-decls does not take scope into account
- From: "paulf at free dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 7 Nov 2008 11:12:06 -0000
- Subject: [Bug c/38047] New: -Wredundant-decls does not take scope into account
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
/* red.c */
void foo(void)
{
extern int x;
/* use x */
x = 1;
}
void bar(void)
{
extern int x;
/* use x */
x = 2;
}
gcc -Wredundant-decls -c red.c
red.c: In function 'bar':
red.c:10: warning: redundant redeclaration of 'x'
red.c:3: warning: previous declaration of 'x' was here
The two "extern int x;" declarations are *not* redundant, and removing either
will cause this code to fail to compile.
Also happens with GCC 4.1.2.
--
Summary: -Wredundant-decls does not take scope into account
Product: gcc
Version: 4.0.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: paulf at free dot fr
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38047