From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19403 invoked by alias); 25 Apr 2011 06:02:52 -0000 Received: (qmail 19383 invoked by uid 22791); 25 Apr 2011 06:02:50 -0000 X-SWARE-Spam-Status: No, hits=-6.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 25 Apr 2011 06:02:37 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p3P62IQf022446 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 25 Apr 2011 02:02:18 -0400 Received: from host1.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p3P62GjO016337 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 25 Apr 2011 02:02:17 -0400 Received: from host1.jankratochvil.net (localhost [127.0.0.1]) by host1.jankratochvil.net (8.14.4/8.14.4) with ESMTP id p3P62F9J002243; Mon, 25 Apr 2011 08:02:15 +0200 Received: (from jkratoch@localhost) by host1.jankratochvil.net (8.14.4/8.14.4/Submit) id p3P62EWc002237; Mon, 25 Apr 2011 08:02:14 +0200 Date: Mon, 25 Apr 2011 06:02:00 -0000 From: Jan Kratochvil To: gcc-patches@gcc.gnu.org Cc: binutils@sourceware.org, gdb-patches@sourceware.org Subject: [gcc patch] Move ENUM_BITFIELD to ansidecl.h Message-ID: <20110425060214.GA1786@host1.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-04/txt/msg00435.txt.bz2 Hi, [patch] ENUM_BITFIELD broke GDB http://sourceware.org/ml/binutils/2011-04/msg00333.html ENUM_BITFIELD has been now defined in bfdlink.h which is included only in some GDB sources. There would be needed some #ifndef ENUM_BITFIELD #define ENUM_BITFIELD but I find it fragile. Is approved its unification into ansidecl.h across gcc/binutils/gdb? GCC still builds with the patch. Thanks, Jan include/ 2011-04-25 Jan Kratochvil * ansidecl.h (ENUM_BITFIELD): New, from gcc/system.h. contrib/ 2011-04-25 Jan Kratochvil * paranoia.cc (ENUM_BITFIELD): Remove. gcc/ 2011-04-25 Jan Kratochvil * system.h (ENUM_BITFIELD): Remove. libcpp/ 2011-04-25 Jan Kratochvil * system.h (ENUM_BITFIELD): Remove. ^^^ gcc approval ------------------------------------------------------------------------------ for binutils part: include/ 2011-04-25 Jan Kratochvil * bfdlink.h (ENUM_BITFIELD): Remove. gdb/ 2011-04-25 Jan Kratochvil * defs.h (ENUM_BITFIELD): Remove. --- include/ansidecl.h (revision 172929) +++ include/ansidecl.h (working copy) @@ -416,6 +416,15 @@ So instead we use the macro below and te #define EXPORTED_CONST const #endif +/* Be conservative and only use enum bitfields with GCC. + FIXME: provide a complete autoconf test for buggy enum bitfields. */ + +#if (GCC_VERSION > 2000) +#define ENUM_BITFIELD(TYPE) __extension__ enum TYPE +#else +#define ENUM_BITFIELD(TYPE) unsigned int +#endif + #ifdef __cplusplus } #endif --- contrib/paranoia.cc (revision 172929) +++ contrib/paranoia.cc (working copy) @@ -169,7 +169,6 @@ lines }; #undef DEFTREECODE -#define ENUM_BITFIELD(X) enum X #define class klass #include "real.h" --- gcc/system.h (revision 172929) +++ gcc/system.h (working copy) @@ -598,15 +598,6 @@ extern int vsnprintf(char *, size_t, con #define HOST_BIT_BUCKET "/dev/null" #endif -/* Be conservative and only use enum bitfields with GCC. - FIXME: provide a complete autoconf test for buggy enum bitfields. */ - -#if (GCC_VERSION > 2000) -#define ENUM_BITFIELD(TYPE) __extension__ enum TYPE -#else -#define ENUM_BITFIELD(TYPE) unsigned int -#endif - #ifndef offsetof #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *) 0)->MEMBER) #endif --- libcpp/system.h (revision 172929) +++ libcpp/system.h (working copy) @@ -357,15 +357,6 @@ extern void abort (void); || (__STDC_VERSION__ >= 199901L)) #endif -/* Be conservative and only use enum bitfields with GCC. - FIXME: provide a complete autoconf test for buggy enum bitfields. */ - -#if (GCC_VERSION > 2000) -#define ENUM_BITFIELD(TYPE) __extension__ enum TYPE -#else -#define ENUM_BITFIELD(TYPE) unsigned int -#endif - #ifndef offsetof #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *) 0)->MEMBER) #endif --- include/bfdlink.h +++ include/bfdlink.h @@ -24,12 +24,6 @@ #ifndef BFDLINK_H #define BFDLINK_H -#if (__GNUC__ * 1000 + __GNUC_MINOR__ > 2000) -#define ENUM_BITFIELD(TYPE) __extension__ enum TYPE -#else -#define ENUM_BITFIELD(TYPE) unsigned int -#endif - /* Which symbols to strip during a link. */ enum bfd_link_strip { --- gdb/defs.h +++ gdb/defs.h @@ -271,15 +271,6 @@ struct cleanup void *arg; }; -/* Be conservative and use enum bitfields only with GCC. - This is copied from gcc 3.3.1, system.h. */ - -#if defined(__GNUC__) && (__GNUC__ >= 2) -#define ENUM_BITFIELD(TYPE) enum TYPE -#else -#define ENUM_BITFIELD(TYPE) unsigned int -#endif - /* vec.h-style vectors of strings want a typedef for char * . */ typedef char * char_ptr;