From: Chris Hanson Date: Sat, 9 Jul 2005 03:26:45 +0000 (+0000) Subject: Work around illegal use of cast expressions in some of the macros. X-Git-Tag: 20090517-FFI~1257 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=18956e9f85df50682c5ee29434f8f54edebcd0e8;p=mit-scheme.git Work around illegal use of cast expressions in some of the macros. GCC 4.0 signals them as errors and refuses to compile the code. Note that the obstack.h file in GNU libc has the same problem. --- diff --git a/v7/src/microcode/obstack.h b/v7/src/microcode/obstack.h index 5212d46d9..5c1b9f3fd 100644 --- a/v7/src/microcode/obstack.h +++ b/v7/src/microcode/obstack.h @@ -279,18 +279,25 @@ int obstack_chunk_size (struct obstack *obstack); ({ struct obstack *__o = (OBSTACK); \ ((__o->next_free + sizeof (void *) > __o->chunk_limit) \ ? _obstack_newchunk (__o, sizeof (void *)) : 0), \ - *((void **)__o->next_free)++ = ((void *)datum); \ + *((void **)__o->next_free) = ((void *)datum); \ + __o->next_free += (sizeof (void *)); \ (void) 0; }) #define obstack_int_grow(OBSTACK,datum) \ ({ struct obstack *__o = (OBSTACK); \ ((__o->next_free + sizeof (int) > __o->chunk_limit) \ ? _obstack_newchunk (__o, sizeof (int)) : 0), \ - *((int *)__o->next_free)++ = ((int)datum); \ + *((int *)__o->next_free) = ((int)datum); \ + __o->next_free += (sizeof (int)); \ (void) 0; }) -#define obstack_ptr_grow_fast(h,aptr) (*((void **)(h)->next_free)++ = (void *)aptr) -#define obstack_int_grow_fast(h,aint) (*((int *)(h)->next_free)++ = (int)aint) +#define obstack_ptr_grow_fast(h,aptr) \ +(*((void **)(h)->next_free) = (void *)aptr, \ + (h)->next_free += (sizeof (void *))) + +#define obstack_int_grow_fast(h,aint) \ +(*((int *)(h)->next_free) = (int)aint, \ + (h)->next_free += (sizeof (int))) #define obstack_blank(OBSTACK,length) \ ({ struct obstack *__o = (OBSTACK); \