bug-glibc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: malloc/obstack.h macros no longer work in C++


From: Alexandre Duret-Lutz
Subject: Re: malloc/obstack.h macros no longer work in C++
Date: 07 Jul 2003 10:39:27 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/21.2.93

| Alexandre, which package did you propose the obstack.h patch for?

glibc (CVS)

| Your patch file refers to malloc/obstack.h, but bison-1.875 has
| ./lib/obstack.h, and the patch fails there, even when I force
| it to try that name.

Bison's copy of obstack.h has a different copyright data.
Here is a cut-down patch that should apply to Bison.

--- lib/obstack.h
+++ lib/obstack.h
@@ -119,12 +119,8 @@
 #endif
 
 #ifndef __INT_TO_PTR
-#if defined __STDC__ && __STDC__
-# define __INT_TO_PTR(P) ((void *) ((P) + (char *) 0))
-#else
 # define __INT_TO_PTR(P) ((P) + (char *) 0)
 #endif
-#endif
 
 /* We need the type of the resulting object.  If __PTRDIFF_TYPE__ is
    defined, as with GNU C, use that; that way we don't pollute the
@@ -582,7 +578,7 @@
     > (h)->chunk_limit - (char *) (h)->chunk)                          \
    ? ((h)->next_free = (h)->chunk_limit) : 0),                         \
   (h)->object_base = (h)->next_free,                                   \
-  __INT_TO_PTR ((h)->temp))
+  (void *) __INT_TO_PTR ((h)->temp))
 
 # if defined __STDC__ && __STDC__
 #  define obstack_free(h,obj)                                          \
-- 
Alexandre Duret-Lutz




reply via email to

[Prev in Thread] Current Thread [Next in Thread]