From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: binutils@sourceware.org
Cc: "H.J. Lu" <hjl.tools@gmail.com>, richard.sandiford@linaro.org
Subject: [patch] ENUM_BITFIELD broke GDB [Re: Change bfd_link_hash_entry.type to a bitfield?]
Date: Sun, 24 Apr 2011 14:49:00 -0000 [thread overview]
Message-ID: <20110424144908.GA21444@host1.jankratochvil.net> (raw)
In-Reply-To: <20110424101401.GQ19947@bubble.grove.modra.org>
On Sun, 24 Apr 2011 12:14:01 +0200, Alan Modra wrote:
> include/
> PR ld/12365
> PR ld/12696
> * bfdlink.h (ENUM_BITFIELD): Define.
This broke GDB HEAD:
In file included from ../bfd/elf-bfd.h:30:0,
from arm-symbian-tdep.c:27:
./../include/bfdlink.h:28:0: error: "ENUM_BITFIELD" redefined [-Werror]
defs.h:278:0: note: this is the location of the previous definition
OK to apply the include/ part?
Thanks,
Jan
include/
2011-04-24 Jan Kratochvil <jan.kratochvil@redhat.com>
* bfdlink.h (ENUM_BITFIELD): Move to ...
* ansidecl.h (ENUM_BITFIELD): ... here, use the one from GCC sources.
gdb/
2011-04-24 Jan Kratochvil <jan.kratochvil@redhat.com>
* defs.h (ENUM_BITFIELD): Remove.
--- a/include/bfdlink.h
+++ b/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
{
--- a/include/ansidecl.h
+++ b/include/ansidecl.h
@@ -416,6 +416,16 @@ So instead we use the macro below and test it against specific values. */
#define EXPORTED_CONST const
#endif
+/* Be conservative and only use enum bitfields with GCC.
+ FIXME: provide a complete autoconf test for buggy enum bitfields.
+ This is copied from gcc 4.7.8, system.h. */
+
+#if (GCC_VERSION > 2000)
+#define ENUM_BITFIELD(TYPE) __extension__ enum TYPE
+#else
+#define ENUM_BITFIELD(TYPE) unsigned int
+#endif
+
#ifdef __cplusplus
}
#endif
--- a/gdb/defs.h
+++ b/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 prev parent reply other threads:[~2011-04-24 14:49 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-20 0:25 PR12365 and common symbols Alan Modra
2011-04-22 22:33 ` H.J. Lu
2011-04-24 10:14 ` Change bfd_link_hash_entry.type to a bitfield? Alan Modra
2011-04-24 14:49 ` Jan Kratochvil [this message]
2011-04-24 15:28 ` [patch] ENUM_BITFIELD broke GDB [Re: Change bfd_link_hash_entry.type to a bitfield?] Andreas Schwab
2011-04-24 15:31 ` [patch] ENUM_BITFIELD broke GDB Jan Kratochvil
2011-04-25 4:04 ` Alan Modra
2011-04-25 18:33 ` [commit include/+gdb/] " Jan Kratochvil
2011-04-21 1:58 Change bfd_link_hash_entry.type to a bitfield? Alan Modra
2011-04-21 2:55 ` H.J. Lu
2011-04-21 11:55 ` Richard Sandiford
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=20110424144908.GA21444@host1.jankratochvil.net \
--to=jan.kratochvil@redhat.com \
--cc=binutils@sourceware.org \
--cc=hjl.tools@gmail.com \
--cc=richard.sandiford@linaro.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).