Work around illegal use of cast expressions in some of the macros.
authorChris Hanson <org/chris-hanson/cph>
Sat, 9 Jul 2005 03:26:45 +0000 (03:26 +0000)
committerChris Hanson <org/chris-hanson/cph>
Sat, 9 Jul 2005 03:26:45 +0000 (03:26 +0000)
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.

v7/src/microcode/obstack.h

index 5212d46d9eb2d188ad50bb5881dd97174b1216dd..5c1b9f3fd81a50361b9dd75820592bd2d063f6f5 100644 (file)
@@ -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);                                    \