public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "aldot at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/50179] New: wrong "set but not used" warning
Date: Wed, 24 Aug 2011 17:25:00 -0000	[thread overview]
Message-ID: <bug-50179-4@http.gcc.gnu.org/bugzilla/> (raw)

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


             reply	other threads:[~2011-08-24 17:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-24 17:25 aldot at gcc dot gnu.org [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-50179-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).