This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] ENUM_BITFIELD broke GDB [Re: Change bfd_link_hash_entry.type to a bitfield?]


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;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]