[Bug c/43914] New: Enum inside switch disfunctional

davidv1992 at msn dot com gcc-bugzilla@gcc.gnu.org
Tue Apr 27 20:52:00 GMT 2010


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



More information about the Gcc-bugs mailing list