This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug debug/28280] New: [4.2 regression] bogus "statement with no effect" warning


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]