(the original discussion started here:
http://gcc.gnu.org/ml/gcc-patches/2011-08/msg00758.html
)

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.

It was fixed in glibc. The equivalent patch (not identical because the files are already different) for gcc would be the one attached.

(ansidecl.h *claims* to come from glibc but the glibc copy was removed in
1997.  obstack.h really does still come from glibc.)

Is someone willing to review (and possibly commit) these 2 patches?

Changelog for include/obstack.h in glibc (guess it should be copied almost as is?):

2011-09-11  Ulrich Drepper  <drep...@gmail.com>
        * obstack.h [!GNUC] (obstack_free): Avoid cast to int.

Changelog for the ansidecl.h part:

2011-08-08 Marc Glisse <marc.gli...@inria.fr>
        * include/ansidecl.h (ENUM_BITFIELD): Always use enum in C++

--
Marc Glisse
Index: obstack.h
===================================================================
--- obstack.h   (revision 178906)
+++ 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)->temp + (char *) (h)->chunk)                          \
-   : (((obstack_free) ((h), (h)->temp + (char *) (h)->chunk), 0), 0)))
+   ? (((h)->next_free = (h)->object_base                               \
+           = (h)->temp + (char *) (h)->chunk), 0)                      \
+   : ((obstack_free) ((h), (h)->temp + (char *) (h)->chunk), 0)))
 
 #endif /* not __GNUC__ or not __STDC__ */
 

Reply via email to