This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug debug/28280] New: [4.2 regression] bogus "statement with no effect" warning
- From: "tbm at cyrius dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Jul 2006 09:13:53 -0000
- Subject: [Bug debug/28280] New: [4.2 regression] bogus "statement with no effect" warning
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
gcc 4.2 shows the following bogus warning message. I'm not sure whether this
is a regression or a new warning but it would be great if this could be
improved. The warning shows up in elfutils, the minimal testcase was extracted
by Eugeniy Meshcheryakov.
41714:tbm@deprecation: ~] /usr/lib/gcc-snapshot/bin/gcc -c -W -Wall test.c
test.c: In function 'fun':
test.c:9: warning: statement with no effect
41715:tbm@deprecation: ~] gcc-4.1 -c -W -Wall test.c
41716:tbm@deprecation: ~] cat test.c
#include <inttypes.h>
void * fun(char *desc, int descsz)
{
struct
{
uint32_t os;
uint32_t version[descsz / 4 - 1];
} *tag = (__typeof (tag)) desc;
return tag;
}
--
Summary: [4.2 regression] bogus "statement with no effect"
warning
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: debug
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: tbm at cyrius dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28280