non-GNU C++ compilers

Submitted by Marc Glisse on Sept. 17, 2011, 7:58 a.m.

Details

Message ID alpine.DEB.2.02.1109170937540.28224@laptop-mg.saclay.inria.fr
State New
Headers show

Commit Message

Marc Glisse Sept. 17, 2011, 7:58 a.m.
(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  <drepper@gmail.com>
 	* obstack.h [!GNUC] (obstack_free): Avoid cast to int.

Changelog for the ansidecl.h part:

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

Comments

Joseph S. Myers Sept. 17, 2011, 11:25 a.m.
On Sat, 17 Sep 2011, Marc Glisse wrote:

> 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  <drepper@gmail.com>
> 	* obstack.h [!GNUC] (obstack_free): Avoid cast to int.
> 
> Changelog for the ansidecl.h part:
> 
> 2011-08-08 Marc Glisse <marc.glisse@inria.fr>
> 	* include/ansidecl.h (ENUM_BITFIELD): Always use enum in C++

These are OK (with ChangeLog entries properly omitting the "include/", 
since they go in include/ChangeLog) in the absence of libiberty maintainer 
objections within 72 hours.

Patch hide | download patch | download mbox

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__ */