[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
obstack.h portability fix
From: |
Paul Eggert |
Subject: |
obstack.h portability fix |
Date: |
Fri, 3 Jan 2003 17:39:06 -0800 |
I installed the following patch, and also reported it to Roland McGrath
so that he can merge it into glibc.
2003-01-03 Paul Eggert <address@hidden>
* lib/obstack.h (__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.
--- lib/obstack.h 13 Dec 2002 11:24:16 -0000 1.6
+++ lib/obstack.h 4 Jan 2003 01:37:48 -0000 1.7
@@ -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,7 +123,11 @@ extern "C" {
#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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- obstack.h portability fix,
Paul Eggert <=