From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: gcc-patches@gcc.gnu.org
Cc: binutils@sourceware.org, gdb-patches@sourceware.org
Subject: [gcc patch] Move ENUM_BITFIELD to ansidecl.h
Date: Mon, 25 Apr 2011 06:02:00 -0000 [thread overview]
Message-ID: <20110425060214.GA1786@host1.jankratochvil.net> (raw)
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 <jan.kratochvil@redhat.com>
* ansidecl.h (ENUM_BITFIELD): New, from gcc/system.h.
contrib/
2011-04-25 Jan Kratochvil <jan.kratochvil@redhat.com>
* paranoia.cc (ENUM_BITFIELD): Remove.
gcc/
2011-04-25 Jan Kratochvil <jan.kratochvil@redhat.com>
* system.h (ENUM_BITFIELD): Remove.
libcpp/
2011-04-25 Jan Kratochvil <jan.kratochvil@redhat.com>
* system.h (ENUM_BITFIELD): Remove.
^^^ gcc approval
------------------------------------------------------------------------------
for binutils part:
include/
2011-04-25 Jan Kratochvil <jan.kratochvil@redhat.com>
* bfdlink.h (ENUM_BITFIELD): Remove.
gdb/
2011-04-25 Jan Kratochvil <jan.kratochvil@redhat.com>
* 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;
next reply other threads:[~2011-04-25 6:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-25 6:02 Jan Kratochvil [this message]
2011-04-25 17:05 ` Ian Lance Taylor
2011-04-25 18:15 ` Jan Kratochvil
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110425060214.GA1786@host1.jankratochvil.net \
--to=jan.kratochvil@redhat.com \
--cc=binutils@sourceware.org \
--cc=gcc-patches@gcc.gnu.org \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).