summaryrefslogtreecommitdiff
path: root/gcc/c-cppbuiltin.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/c-cppbuiltin.c')
-rw-r--r--gcc/c-cppbuiltin.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/gcc/c-cppbuiltin.c b/gcc/c-cppbuiltin.c
index 12e0879c57d..e9f60f63bf3 100644
--- a/gcc/c-cppbuiltin.c
+++ b/gcc/c-cppbuiltin.c
@@ -577,7 +577,7 @@ void
builtin_define_std (const char *macro)
{
size_t len = strlen (macro);
- char *buff = alloca (len + 5);
+ char *buff = (char *) alloca (len + 5);
char *p = buff + 2;
char *q = p + len;
@@ -623,7 +623,7 @@ builtin_define_with_value (const char *macro, const char *expansion, int is_str)
if (is_str)
extra += 2; /* space for two quote marks */
- buf = alloca (mlen + elen + extra);
+ buf = (char *) alloca (mlen + elen + extra);
if (is_str)
sprintf (buf, "%s=\"%s\"", macro, expansion);
else
@@ -641,7 +641,7 @@ builtin_define_with_value_n (const char *macro, const char *expansion, size_t el
size_t mlen = strlen (macro);
/* Space for an = and a NUL. */
- buf = alloca (mlen + elen + 2);
+ buf = (char *) alloca (mlen + elen + 2);
memcpy (buf, macro, mlen);
buf[mlen] = '=';
memcpy (buf + mlen + 1, expansion, elen);
@@ -659,7 +659,7 @@ builtin_define_with_int_value (const char *macro, HOST_WIDE_INT value)
size_t vlen = 18;
size_t extra = 2; /* space for = and NUL. */
- buf = alloca (mlen + vlen + extra);
+ buf = (char *) alloca (mlen + vlen + extra);
memcpy (buf, macro, mlen);
buf[mlen] = '=';
sprintf (buf + mlen + 1, HOST_WIDE_INT_PRINT_DEC, value);
@@ -736,7 +736,8 @@ builtin_define_type_max (const char *macro, tree type, int is_long)
value = values[idx + TYPE_UNSIGNED (type)];
suffix = suffixes[is_long * 2 + TYPE_UNSIGNED (type)];
- buf = alloca (strlen (macro) + 1 + strlen (value) + strlen (suffix) + 1);
+ buf = (char *) alloca (strlen (macro) + 1 + strlen (value)
+ + strlen (suffix) + 1);
sprintf (buf, "%s=%s%s", macro, value, suffix);
cpp_define (parse_in, buf);