changeset 4253:bd7590d0c6b6

(__INT_TO_PTR) [__STDC__]: Cast result to (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5 when compiling Bison 1.875's `bitset bset = obstack_alloc (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
author Paul Eggert <eggert@cs.ucla.edu>
date Thu, 13 Mar 2003 21:13:59 +0000
parents 7bcd3280502a
children 14b537acd198
files lib/obstack.h
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lib/obstack.h	Thu Mar 13 19:49:33 2003 +0000
+++ b/lib/obstack.h	Thu Mar 13 21:13:59 2003 +0000
@@ -1,5 +1,5 @@
 /* obstack.h - object stack macros
-   Copyright (C) 1988,89,90,91,92,93,94,96,97,98,99 Free Software Foundation, Inc.
+   Copyright (C) 1988,89,90,91,92,93,94,96,97,98,99,2003 Free Software Foundation, Inc.
 
    This file is part of the GNU C Library.  Its master source is NOT part of
    the C library, however.  The master source lives in /gd/gnu/lib.
@@ -123,8 +123,12 @@
 #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