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:[EMAIL PROTECTED]: ~] /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:[EMAIL PROTECTED]: ~] gcc-4.1 -c -W -Wall test.c 41716:[EMAIL PROTECTED]: ~] 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