public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/43914]  New: Enum inside switch disfunctional
@ 2010-04-27 20:52 davidv1992 at msn dot com
  2010-04-27 20:54 ` [Bug c/43914] " pinskia at gcc dot gnu dot org
  0 siblings, 1 reply; 2+ messages in thread
From: davidv1992 at msn dot com @ 2010-04-27 20:52 UTC (permalink / raw)
  To: gcc-bugs

Following code causes output "Strange" instead of the expected "A":

#include <stdio.h>

typedef enum {a, b, c} k;

k s;

int main()
{
        s = a;
        switch(s)
        {
        a:
                printf("A\n");
        b:
                printf("B\n");
        c:
                printf("C\n");
        default:
                printf("Strange\n");
        }
}


-- 
           Summary: Enum inside switch disfunctional
           Product: gcc
           Version: 4.4.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: davidv1992 at msn dot com
 GCC build triplet: Unknown (x86-64 ubuntu 9.04)
  GCC host triplet: Unknown (x86-64 ubuntu 9.04)
GCC target triplet: Unknown (x86-64 ubuntu 9.04)


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


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

* [Bug c/43914] Enum inside switch disfunctional
  2010-04-27 20:52 [Bug c/43914] New: Enum inside switch disfunctional davidv1992 at msn dot com
@ 2010-04-27 20:54 ` pinskia at gcc dot gnu dot org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2010-04-27 20:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2010-04-27 20:54 -------
        a:

That defines a label called a rather than a case statement.  You want "case a:"


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


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


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

end of thread, other threads:[~2010-04-27 20:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-27 20:52 [Bug c/43914] New: Enum inside switch disfunctional davidv1992 at msn dot com
2010-04-27 20:54 ` [Bug c/43914] " pinskia at gcc dot gnu dot 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).