Bug 53790 - gcc doesn't handle typed enums with dup. values in switch statements correctly
gcc doesn't handle typed enums with dup. values in switch statements correctly
Status: CLOSED RAWHIDE
Product: Red Hat Public Beta
Classification: Retired
Component: gcc (Show other bugs)
roswell
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-09-18 14:06 EDT by Jonathan Blandford
Modified: 2013-04-02 00:15 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-02-18 17:20:23 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jonathan Blandford 2001-09-18 14:06:23 EDT
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 17:20:23 EST
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.