This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/23228] New: Silly "unused variable" warning after redeclaration of a local variable
- From: "steven at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Aug 2005 11:15:54 -0000
- Subject: [Bug c/23228] New: Silly "unused variable" warning after redeclaration of a local variable
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Maybe there are similar issues elsewhere, but this one happened
to bother me... This warning is also issed by GCC 3.3, so I guess
it is not a regression. But it's a silly warning after errors.
=================== t.c ===================
int bar (void);
int foo (void)
{
int i;
int i;
i = bar ();
return 2*i;
}
===========================================
$ gcc -Wall -Wextra -O2 t.c
t.c: In function 'foo':
t.c:5: error: redeclaration of 'i' with no linkage
t.c:4: error: previous declaration of 'i' was here
t.c:4: warning: unused variable 'i'
$
--
Summary: Silly "unused variable" warning after redeclaration of a
local variable
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Keywords: diagnostic
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: steven at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org,jsm28 at gcc dot gnu dot
org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23228