From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4084 invoked by alias); 2 May 2008 20:14:07 -0000 Received: (qmail 3879 invoked by uid 48); 2 May 2008 20:13:24 -0000 Date: Fri, 02 May 2008 20:14:00 -0000 Subject: [Bug c/36113] New: fix C enumerators X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "mrs at apple dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-05/txt/msg00131.txt.bz2 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 #include #include #include 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