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 c/50179] New: wrong "set but not used" warning


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__;
        }))
    );
}


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