aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorBernardo Innocenti <bernie@develer.com>2004-07-13 22:54:38 +0200
committerBernardo Innocenti <bernie@gcc.gnu.org>2004-07-13 22:54:38 +0200
commit5557e16d2a4707e68b2de8bc732aca79f09a1055 (patch)
treef8cecab53232e9ebcd43e6bdf97e6e810b05c431 /include
parentee536902d67e3c2a3f7d54676b4099d7ac6ab797 (diff)
downloadgcc-5557e16d2a4707e68b2de8bc732aca79f09a1055.zip
gcc-5557e16d2a4707e68b2de8bc732aca79f09a1055.tar.gz
gcc-5557e16d2a4707e68b2de8bc732aca79f09a1055.tar.bz2
libiberty.h (ASTRDUP): Add casts required for stricter type conversion rules of C++.
* libiberty.h (ASTRDUP): Add casts required for stricter type conversion rules of C++. * obstack.h (obstack_free): Likewise. From-SVN: r84642
Diffstat (limited to 'include')
-rw-r--r--include/ChangeLog6
-rw-r--r--include/libiberty.h4
-rw-r--r--include/obstack.h4
3 files changed, 10 insertions, 4 deletions
diff --git a/include/ChangeLog b/include/ChangeLog
index a4df91a..55ea885 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,9 @@
+2004-07-13 Bernardo Innocenti <bernie@develer.com>
+
+ * libiberty.h (ASTRDUP): Add casts required for stricter
+ type conversion rules of C++.
+ * obstack.h (obstack_free): Likewise.
+
2004-05-04 Andreas Jaeger <aj@suse.de>
* demangle.h: Do not use C++ reserved keyword typename as
diff --git a/include/libiberty.h b/include/libiberty.h
index 761b2cf..5c10153 100644
--- a/include/libiberty.h
+++ b/include/libiberty.h
@@ -309,7 +309,7 @@ extern PTR C_alloca PARAMS ((size_t)) ATTRIBUTE_MALLOC;
# define ASTRDUP(X) \
(__extension__ ({ const char *const libiberty_optr = (X); \
const unsigned long libiberty_len = strlen (libiberty_optr) + 1; \
- char *const libiberty_nptr = alloca (libiberty_len); \
+ char *const libiberty_nptr = (char *const) alloca (libiberty_len); \
(char *) memcpy (libiberty_nptr, libiberty_optr, libiberty_len); }))
#else
# define alloca(x) C_alloca(x)
@@ -323,7 +323,7 @@ extern unsigned long libiberty_len;
# define ASTRDUP(X) \
(libiberty_optr = (X), \
libiberty_len = strlen (libiberty_optr) + 1, \
- libiberty_nptr = alloca (libiberty_len), \
+ libiberty_nptr = (char *) alloca (libiberty_len), \
(char *) memcpy (libiberty_nptr, libiberty_optr, libiberty_len))
#endif
diff --git a/include/obstack.h b/include/obstack.h
index 5496ff2..007853e 100644
--- a/include/obstack.h
+++ b/include/obstack.h
@@ -494,9 +494,9 @@ __extension__ \
# define obstack_free(OBSTACK, OBJ) \
__extension__ \
({ struct obstack *__o = (OBSTACK); \
- void *__obj = (OBJ); \
+ void *__obj = (void *) (OBJ); \
if (__obj > (void *)__o->chunk && __obj < (void *)__o->chunk_limit) \
- __o->next_free = __o->object_base = __obj; \
+ __o->next_free = __o->object_base = (char *) __obj; \
else (obstack_free) (__o, __obj); })
#else /* not __GNUC__ or not __STDC__ */