public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/50179] New: wrong "set but not used" warning
@ 2011-08-24 17:25 aldot at gcc dot gnu.org
  2011-08-25 10:26 ` [Bug c/50179] " jakub at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: aldot at gcc dot gnu.org @ 2011-08-24 17:25 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-08-26 16:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-24 17:25 [Bug c/50179] New: wrong "set but not used" warning aldot at gcc dot gnu.org
2011-08-25 10:26 ` [Bug c/50179] " jakub at gcc dot gnu.org
2011-08-25 10:33 ` [Bug c/50179] [4.6/4.7 Regression] " jakub at gcc dot gnu.org
2011-08-26 14:48 ` jakub at gcc dot gnu.org
2011-08-26 14:54 ` jakub at gcc dot gnu.org
2011-08-26 16:36 ` jakub at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).