Message ID | alpine.DEB.2.02.1108081332500.3776@stedding.saclay.inria.fr |
---|---|
State | New |
Headers | show |
On Mon, 8 Aug 2011, Marc Glisse wrote:
> * include/obstack.h (obstack_free): Cast to char* instead of int
This header comes from glibc/gnulib. Although some local changes have
been made to it in the past, sending any fixes to upstream glibc is still
a good idea.
(ansidecl.h *claims* to come from glibc but the glibc copy was removed in
1997. obstack.h really does still come from glibc.)
On Mon, 8 Aug 2011, Joseph S. Myers wrote: > On Mon, 8 Aug 2011, Marc Glisse wrote: > >> * include/obstack.h (obstack_free): Cast to char* instead of int > > This header comes from glibc/gnulib. Although some local changes have > been made to it in the past, sending any fixes to upstream glibc is still > a good idea. > > (ansidecl.h *claims* to come from glibc but the glibc copy was removed in > 1997. obstack.h really does still come from glibc.) Ah, ok, thanks, that's confusing indeed. /me takes a look at malloc/obstack.h in glibc. Er, the 2 seem to have diverged quite a bit. I will send a similar patch to glibc (not quite the same as obstack_free already looks different), but it looks like gcc still needs patching independently.
On Mon, 8 Aug 2011, Joseph S. Myers wrote: > On Mon, 8 Aug 2011, Marc Glisse wrote: > >> * include/obstack.h (obstack_free): Cast to char* instead of int > > This header comes from glibc/gnulib. Although some local changes have > been made to it in the past, sending any fixes to upstream glibc is still > a good idea. http://sourceware.org/bugzilla/show_bug.cgi?id=13067 (doesn't help gcc much, but it is in glibc's bugzilla now)
Index: include/ansidecl.h =================================================================== --- include/ansidecl.h (revision 177557) +++ include/ansidecl.h (working copy) @@ -416,10 +416,12 @@ #define EXPORTED_CONST const #endif -/* Be conservative and only use enum bitfields with GCC. +/* Be conservative and only use enum bitfields with C++ or GCC. FIXME: provide a complete autoconf test for buggy enum bitfields. */ -#if (GCC_VERSION > 2000) +#ifdef __cplusplus +#define ENUM_BITFIELD(TYPE) enum TYPE +#elif (GCC_VERSION > 2000) #define ENUM_BITFIELD(TYPE) __extension__ enum TYPE #else #define ENUM_BITFIELD(TYPE) unsigned int Index: include/obstack.h =================================================================== --- include/obstack.h (revision 177557) +++ include/obstack.h (working copy) @@ -532,9 +532,9 @@ # define obstack_free(h,obj) \ ( (h)->temp = (char *) (obj) - (char *) (h)->chunk, \ (((h)->temp > 0 && (h)->temp < (h)->chunk_limit - (char *) (h)->chunk)\ - ? (int) ((h)->next_free = (h)->object_base \ + ? ((h)->next_free = (h)->object_base \ = (h)->temp + (char *) (h)->chunk) \ - : (((obstack_free) ((h), (h)->temp + (char *) (h)->chunk), 0), 0))) + : ((obstack_free) ((h), (h)->temp + (char *) (h)->chunk), (char*)0))) #endif /* not __GNUC__ or not __STDC__ */