This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/36113] New: fix C enumerators
- From: "mrs at apple dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 May 2008 20:13:24 -0000
- Subject: [Bug c/36113] New: fix C enumerators
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
For compatibility with C++ and more reasonable GNU semantics, would we place
make the below program not print 0. Essentially, the type of all the
enumerators should be the underlying type of the enum, not the type that fits
the init.
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <inttypes.h>
int main(void) {
enum {
dummy = (1ULL<<63),
SomeConstant = 0x1
} MyEnum;
#define MY_MACRO(value) ((value) << 60)
printf("MY_MACRO(SomeConstant) == 0x%llx.\n", MY_MACRO(SomeConstant));
return 0;
}
--
Summary: fix C enumerators
Product: gcc
Version: 4.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: mrs at apple dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36113