public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/46015] New: -Wunused-but-set-variable false positive
@ 2010-10-14 12:01 foldy at rmki dot kfki.hu
  2010-10-14 13:45 ` [Bug c/46015] [4.6 Regression] " rguenth at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: foldy at rmki dot kfki.hu @ 2010-10-14 12:01 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46015

           Summary: -Wunused-but-set-variable false positive
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: foldy@rmki.kfki.hu


/* test.c */

int f(int i)
{
  static void* labs[2] =
    { &&lab1,
      &&lab2
    };

  goto *(labs[i&1]);

 lab1: return 1;
 lab2: return 2;

  return 0;
}

/* test.c end */

GCC 4.6.0 20101014 -Wall prints the followiung warning:

test.c: In function 'f':
test.c:5:16: warning: variable 'labs' set but not used
[-Wunused-but-set-variable]

(GCC 4.5.1 is OK.)


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

end of thread, other threads:[~2010-10-18 16:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-14 12:01 [Bug c/46015] New: -Wunused-but-set-variable false positive foldy at rmki dot kfki.hu
2010-10-14 13:45 ` [Bug c/46015] [4.6 Regression] " rguenth at gcc dot gnu.org
2010-10-14 19:30 ` [Bug c/46015] [4.6 Regression] -Wunused-but-set-variable warns for arrays used in gotos jakub at gcc dot gnu.org
2010-10-18 15:55 ` jakub at gcc dot gnu.org
2010-10-18 16:16 ` 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).