This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [patch] ENUM_BITFIELD broke GDB
On Sun, 24 Apr 2011 17:28:15 +0200, Andreas Schwab wrote:
> Jan Kratochvil <jan.kratochvil@redhat.com> writes:
>
> > +/* 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. */
>
> What is gcc 4.7.8?
A typo, 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.0 20110424, 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;