This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
exp/1051: GNU/Linux, gcc, C, enum
- From: daniel dot vallstrom at safelogic dot se
- To: gdb-gnats at sources dot redhat dot com
- Date: 12 Feb 2003 00:37:21 -0000
- Subject: exp/1051: GNU/Linux, gcc, C, enum
- Reply-to: daniel dot vallstrom at safelogic dot se
>Number: 1051
>Category: exp
>Synopsis: GNU/Linux, gcc, C, enum
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Wed Feb 12 00:38:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: daniel.vallstrom@safelogic.se
>Release: GNU gdb Red Hat Linux (5.2.1-4)
>Organization:
>Environment:
Linux danielv 2.4.18-24.8.0 #1 Fri Jan 31 07:28:55 EST 2003 i686 athlon i386 GNU/Linux
gcc (GCC) 3.2 20020903 (Red Hat Linux 8.0 3.2-7)
This GDB was configured as "i386-redhat-linux"...
>Description:
All enumeration constants have type int but gdb seems to think that they have the type of the enumeration (unsigned int in the example below) --- an understandable mistake. For example:
(gdb) print (firstEnumMember-1)
$6 = 4294967295
(gdb) print ((int)firstEnumMember-1)
$7 = -1
where firstEnumMember is the first enumeration constant in a typical enumeration:
typedef enum
{
firstEnumMember,
secondEnumMember
} EnumType;
>How-To-Repeat:
Should be very easy. See the bug description.
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: