From patchwork Sat Sep 17 07:58:40 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: non-GNU C++ compilers Date: Fri, 16 Sep 2011 21:58:40 -0000 From: Marc Glisse X-Patchwork-Id: 115099 Message-Id: To: "Joseph S. Myers" Cc: gcc-patches@gcc.gnu.org (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 * obstack.h [!GNUC] (obstack_free): Avoid cast to int. Changelog for the ansidecl.h part: 2011-08-08 Marc Glisse * include/ansidecl.h (ENUM_BITFIELD): Always use enum in C++ 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__ */