This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/50179] New: wrong "set but not used" warning
- From: "aldot at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 24 Aug 2011 17:22:11 +0000
- Subject: [Bug c/50179] New: wrong "set but not used" warning
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50179
Bug #: 50179
Summary: wrong "set but not used" warning
Classification: Unclassified
Product: gcc
Version: 4.6.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: aldot@gcc.gnu.org
To me it looks like the warning below is not correct. The variable is in fact
used.
$ gcc-4.6 -c -o bug.o bug.c -Wall
bug.c: In function âhuhâ:
bug.c:5:15: warning: variable âb__â set but not used
[-Wunused-but-set-variable]
$ cat bug.c
#include <stdio.h>
void huh(void) {
printf("%s", (__extension__(
{
static char b__[129];
b__[0] = 1;
b__[1] = 2;
b__[2] = 0;
b__;
}))
);
}