]> gcc.gnu.org Git - gcc.git/commitdiff
Avoids false positives with -Wcast-qual:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>
Wed, 1 Sep 1999 14:44:56 +0000 (14:44 +0000)
committerKaveh Ghazi <ghazi@gcc.gnu.org>
Wed, 1 Sep 1999 14:44:56 +0000 (14:44 +0000)
* obstack.h (obstack_grow, obstack_grow0): Move (char*) casts
in calls to `_obstack_memcpy' from here ...

(_obstack_memcpy): ... to here, except in the __STDC__ case which
doesn't need it.

From-SVN: r29028

include/ChangeLog
include/obstack.h

index b2468c99d2c32b05e56b039988eed890386704dd..41af292ebbf388a5982f2b6a23b944d28079a4ac 100644 (file)
@@ -1,3 +1,11 @@
+1999-09-01  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+       * obstack.h (obstack_grow, obstack_grow0): Move (char*) casts
+       in calls to `_obstack_memcpy' from here ...
+
+       (_obstack_memcpy): ... to here, except in the __STDC__ case which
+       doesn't need it.
+
 1999-08-30  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
        * libiberty.h (getpwd): Prototype.
index 38e96777660d5bbdafa108ae60def43e5221b750..a20ab55967a2aeba81039175b46ae304eb8ea214 100644 (file)
@@ -143,12 +143,16 @@ extern "C" {
 
 #if defined _LIBC || defined HAVE_STRING_H
 # include <string.h>
-# define _obstack_memcpy(To, From, N) memcpy ((To), (From), (N))
+# if defined __STDC__ && __STDC__
+#  define _obstack_memcpy(To, From, N) memcpy ((To), (From), (N))
+# else
+#  define _obstack_memcpy(To, From, N) memcpy ((To), (char *)(From), (N))
+# endif
 #else
 # ifdef memcpy
-#  define _obstack_memcpy(To, From, N) memcpy ((To), (From), (N))
+#  define _obstack_memcpy(To, From, N) memcpy ((To), (char *)(From), (N))
 # else
-#  define _obstack_memcpy(To, From, N) bcopy ((From), (To), (N))
+#  define _obstack_memcpy(To, From, N) bcopy ((char *)(From), (To), (N))
 # endif
 #endif
 
@@ -385,7 +389,7 @@ __extension__                                                               \
    int __len = (length);                                               \
    if (__o->next_free + __len > __o->chunk_limit)                      \
      _obstack_newchunk (__o, __len);                                   \
-   _obstack_memcpy (__o->next_free, (char *) (where), __len);          \
+   _obstack_memcpy (__o->next_free, (where), __len);                   \
    __o->next_free += __len;                                            \
    (void) 0; })
 
@@ -395,7 +399,7 @@ __extension__                                                               \
    int __len = (length);                                               \
    if (__o->next_free + __len + 1 > __o->chunk_limit)                  \
      _obstack_newchunk (__o, __len + 1);                               \
-   _obstack_memcpy (__o->next_free, (char *) (where), __len);          \
+   _obstack_memcpy (__o->next_free, (where), __len);                   \
    __o->next_free += __len;                                            \
    *(__o->next_free)++ = 0;                                            \
    (void) 0; })
@@ -510,14 +514,14 @@ __extension__                                                             \
 ( (h)->temp = (length),                                                        \
   (((h)->next_free + (h)->temp > (h)->chunk_limit)                     \
    ? (_obstack_newchunk ((h), (h)->temp), 0) : 0),                     \
-  _obstack_memcpy ((h)->next_free, (char *) (where), (h)->temp),       \
+  _obstack_memcpy ((h)->next_free, (where), (h)->temp),                        \
   (h)->next_free += (h)->temp)
 
 # define obstack_grow0(h,where,length)                                 \
 ( (h)->temp = (length),                                                        \
   (((h)->next_free + (h)->temp + 1 > (h)->chunk_limit)                 \
    ? (_obstack_newchunk ((h), (h)->temp + 1), 0) : 0),                 \
-  _obstack_memcpy ((h)->next_free, (char *) (where), (h)->temp),       \
+  _obstack_memcpy ((h)->next_free, (where), (h)->temp),                        \
   (h)->next_free += (h)->temp,                                         \
   *((h)->next_free)++ = 0)
 
This page took 0.063151 seconds and 5 git commands to generate.