Bug 53790 - gcc doesn't handle typed enums with dup. values in switch statements correctly
Summary: gcc doesn't handle typed enums with dup. values in switch statements correctly
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Public Beta
Classification: Retired
Component: gcc
Version: roswell
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-09-18 18:06 UTC by Jonathan Blandford
Modified: 2013-04-02 04:15 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2003-02-18 22:20:23 UTC
Embargoed:


Attachments (Terms of Use)

Description Jonathan Blandford 2001-09-18 18:06:23 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.2) Gecko/20010809

Description of problem:


Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
consider the following program:

typedef enum
{
  FOO_A,
  FOO_B,
  FOO_C=FOO_A
} Foo;
int
main (int argc, char *argv[])
{
  Foo foo = 0;
  switch (foo)
    {
    case FOO_A:
      break;
    case FOO_B:
      break;
    }
  return 0;
}

Compiling gives me:

%gcc -Wall -o test ./test.c
./test.c: In function `main':
./test.c:18: warning: enumeration value `FOO_C' not handled in switch

However, I can't put FOO_C in the switch statement as gcc will then
(rightly) warn me of duplicate values.

Additional info:

Comment 1 Jonathan Blandford 2003-02-18 22:20:23 UTC
Seems to have been fixed at some point.  I'm going to go ahead and close it.


Note You need to log in before you can comment on or make changes to this bug.