tag 323739 patch thanks The attached patch allows mit-scheme to build with gcc 4.0. Fixes to obstack.h were backported from the current glibc version.
Thanks, Matej
diff -ruN -x TAGS -x '*.html' -x 'config.*' mit-scheme-7.7.90/src/microcode/obstack.h mit-scheme-7.7.90.mv/src/microcode/obstack.h --- mit-scheme-7.7.90/src/microcode/obstack.h 2002-11-26 06:32:30.000000000 +0100 +++ mit-scheme-7.7.90.mv/src/microcode/obstack.h 2005-09-08 21:01:59.000000000 +0200 @@ -280,19 +280,24 @@ #define obstack_ptr_grow(OBSTACK,datum) \ ({ struct obstack *__o = (OBSTACK); \ ((__o->next_free + sizeof (void *) > __o->chunk_limit) \ - ? _obstack_newchunk (__o, sizeof (void *)) : 0), \ - *((void **)__o->next_free)++ = ((void *)datum); \ + ? _obstack_newchunk (__o, sizeof (void *)) : 0); \ + *(const void **) __o->next_free = (datum); \ + __o->next_free += sizeof (const 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); \ + ? _obstack_newchunk (__o, sizeof (int)) : 0); \ + *(int *) __o->next_free = (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) \ + (((const void **) ((h)->next_free += sizeof (void *)))[-1] = (aptr)) + +#define obstack_int_grow_fast(h,aint) \ + (((int *) ((h)->next_free += sizeof (int)))[-1] = (aint)) #define obstack_blank(OBSTACK,length) \ ({ struct obstack *__o = (OBSTACK); \ @@ -374,8 +379,11 @@ ? (_obstack_newchunk ((h), sizeof (int)), 0) : 0), \ *((int *)(((h)->next_free+=sizeof(int))-sizeof(int))) = ((int)datum)) -#define obstack_ptr_grow_fast(h,aptr) (*((char **)(h)->next_free)++ = (char *)aptr) -#define obstack_int_grow_fast(h,aint) (*((int *)(h)->next_free)++ = (int)aint) +#define obstack_ptr_grow_fast(h,aptr) \ + (((const void **) ((h)->next_free += sizeof (void *)))[-1] = (aptr)) + +#define obstack_int_grow_fast(h,aint) \ + (((int *) ((h)->next_free += sizeof (int)))[-1] = (aint)) #define obstack_blank(h,length) \ ( (h)->temp = (length), \ diff -ruN -x TAGS -x '*.html' -x 'config.*' mit-scheme-7.7.90/src/microcode/uxio.c mit-scheme-7.7.90.mv/src/microcode/uxio.c --- mit-scheme-7.7.90/src/microcode/uxio.c 2003-03-25 02:09:20.000000000 +0100 +++ mit-scheme-7.7.90.mv/src/microcode/uxio.c 2005-09-08 21:04:59.000000000 +0200 @@ -240,7 +240,7 @@ return ((scr < 0) ? 0 : scr); } -#ifdef _POSIX +#ifdef __STDC__ #include <string.h> #else extern int EXFUN (strlen, (CONST char *));