From 668112a61712eeeaedcbafc85d5741ecd7bb827a Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Wed, 25 Sep 1991 20:36:47 +0000 Subject: [PATCH] Fix casting bug in __INT_TO_PTR. --- v7/src/microcode/obstack.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/v7/src/microcode/obstack.h b/v7/src/microcode/obstack.h index 0ab906063..be5e42109 100644 --- a/v7/src/microcode/obstack.h +++ b/v7/src/microcode/obstack.h @@ -103,6 +103,8 @@ Summary: #ifndef __OBSTACKS__ #define __OBSTACKS__ +#include "ansidecl.h" + /* We use subtraction of (char *)0 instead of casting to int because on word-addressable machines a simple cast to int may ignore the byte-within-word field of the pointer. */ @@ -112,7 +114,7 @@ Summary: #endif #ifndef __INT_TO_PTR -#define __INT_TO_PTR(P) ((P) + (char *)0) +#define __INT_TO_PTR(P) ((PTR) ((P) + (char *)0)) #endif struct _obstack_chunk /* Lives at front of each chunk. */ -- 2.25.1