summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbernie <bernie@138bc75d-0d04-0410-961f-82ee72b054a4>2004-07-25 22:17:02 +0000
committerbernie <bernie@138bc75d-0d04-0410-961f-82ee72b054a4>2004-07-25 22:17:02 +0000
commit4fd61bc65be58c3ae6a337331a66569609fa24fc (patch)
treed4ef1636ca1b7a8d3ec231e0f5b6e84697ddeb94
parentf4d1037064bcbf270661c9e2b02defce1e998690 (diff)
downloadgcc-4fd61bc65be58c3ae6a337331a66569609fa24fc.tar.gz
* basic-block.h (reorder_block_def): Rename to reorder_block_def_p.
* c-common.c: Add missing casts from void * to other types. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-pragma.c: Likewise. * c-typeck.c: Likewise. * defaults.h: Likewise. * genconstants.c: Likewise. * gengtype-lex.l: Likewise. * genmodes.c: Likewise. * read-rtl.c: Likewise. * rtl.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@85166 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog16
-rw-r--r--gcc/basic-block.h2
-rw-r--r--gcc/c-common.c19
-rw-r--r--gcc/c-decl.c2
-rw-r--r--gcc/c-format.c32
-rw-r--r--gcc/c-lex.c4
-rw-r--r--gcc/c-pragma.c2
-rw-r--r--gcc/c-typeck.c14
-rw-r--r--gcc/defaults.h3
-rw-r--r--gcc/genconstants.c4
-rw-r--r--gcc/gengtype-lex.l46
-rw-r--r--gcc/genmodes.c2
-rw-r--r--gcc/read-rtl.c8
-rw-r--r--gcc/rtl.c7
14 files changed, 97 insertions, 64 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c47dd7b6652..6815008cab5 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,21 @@
2004-07-25 Bernardo Innocenti <bernie@develer.com>
+ * basic-block.h (reorder_block_def): Rename to reorder_block_def_p.
+ * c-common.c: Add missing casts from void * to other types.
+ * c-decl.c: Likewise.
+ * c-format.c: Likewise.
+ * c-lex.c: Likewise.
+ * c-pragma.c: Likewise.
+ * c-typeck.c: Likewise.
+ * defaults.h: Likewise.
+ * genconstants.c: Likewise.
+ * gengtype-lex.l: Likewise.
+ * genmodes.c: Likewise.
+ * read-rtl.c: Likewise.
+ * rtl.c: Likewise.
+
+2004-07-25 Bernardo Innocenti <bernie@develer.com>
+
* bitmap.c: Use type-safe memory allocation macros from libiberty.
* c-common.c: Likewise.
* c-decl.c: Likewise.
diff --git a/gcc/basic-block.h b/gcc/basic-block.h
index c7d2c072146..bb334fd2add 100644
--- a/gcc/basic-block.h
+++ b/gcc/basic-block.h
@@ -300,7 +300,7 @@ typedef struct reorder_block_def
/* These fields are used by bb-reorder pass. */
int visited;
-} *reorder_block_def;
+} *reorder_block_def_p;
#define BB_FREQ_MAX 10000
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 245203613d6..ddd8e8766b0 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -740,7 +740,7 @@ fname_as_string (int pretty_p)
int len = strlen (name) + 3; /* Two for '"'s. One for NULL. */
cpp_string cstr = { 0, 0 }, strname;
- namep = xmalloc (len);
+ namep = XNEWVEC (char, len);
snprintf (namep, len, "\"%s\"", name);
strname.text = (unsigned char *) namep;
strname.len = len - 1;
@@ -1394,7 +1394,7 @@ verify_sequence_points (tree expr)
if (tlist_firstobj == 0)
{
gcc_obstack_init (&tlist_obstack);
- tlist_firstobj = obstack_alloc (&tlist_obstack, 0);
+ tlist_firstobj = (char *) obstack_alloc (&tlist_obstack, 0);
}
verify_tree (expr, &before_sp, &after_sp, 0);
@@ -2762,7 +2762,7 @@ c_sizeof_or_alignof_type (tree type, enum tree_code op, int complain)
}
else
{
- if (op == SIZEOF_EXPR)
+ if (op == (enum tree_code) SIZEOF_EXPR)
/* Convert in case a char is more than one unit. */
value = size_binop (CEIL_DIV_EXPR, TYPE_SIZE_UNIT (type),
size_int (TYPE_PRECISION (char_type_node)
@@ -3658,7 +3658,7 @@ static int
match_case_to_enum (splay_tree_node node, void *data)
{
tree label = (tree) node->value;
- tree type = data;
+ tree type = (tree) data;
/* Skip default case. */
if (!CASE_LOW (label))
@@ -4280,7 +4280,7 @@ handle_mode_attribute (tree *node, tree name, tree args,
if (len > 4 && p[0] == '_' && p[1] == '_'
&& p[len - 1] == '_' && p[len - 2] == '_')
{
- char *newp = alloca (len - 1);
+ char *newp = (char *) alloca (len - 1);
strcpy (newp, &p[2]);
newp[len - 4] = '\0';
@@ -5199,8 +5199,9 @@ check_function_arguments_recurse (void (*callback)
int
field_decl_cmp (const void *x_p, const void *y_p)
{
- const tree *const x = x_p;
- const tree *const y = y_p;
+ const tree *const x = (const tree *const) x_p;
+ const tree *const y = (const tree *const) y_p;
+
if (DECL_NAME (*x) == DECL_NAME (*y))
/* A nontype is "greater" than a type. */
return (TREE_CODE (*y) == TYPE_DECL) - (TREE_CODE (*x) == TYPE_DECL);
@@ -5224,8 +5225,8 @@ pointer operator in resort_data. */
static int
resort_field_decl_cmp (const void *x_p, const void *y_p)
{
- const tree *const x = x_p;
- const tree *const y = y_p;
+ const tree *const x = (const tree *const) x_p;
+ const tree *const y = (const tree *const) y_p;
if (DECL_NAME (*x) == DECL_NAME (*y))
/* A nontype is "greater" than a type. */
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 1c4510ad590..47cfd5cc24f 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -2963,7 +2963,7 @@ finish_decl (tree decl, tree init, tree asmspec_tree)
{
/* ASMSPEC is given, and not the name of a register. Mark the
name with a star so assemble_name won't munge it. */
- char *starred = alloca (strlen (asmspec) + 2);
+ char *starred = (char *) alloca (strlen (asmspec) + 2);
starred[0] = '*';
strcpy (starred + 1, asmspec);
diff --git a/gcc/c-format.c b/gcc/c-format.c
index 37a58c203e6..019b91a7339 100644
--- a/gcc/c-format.c
+++ b/gcc/c-format.c
@@ -889,8 +889,8 @@ init_dollar_format_checking (int first_arg_num, tree params)
if (dollar_arguments_pointer_p)
free (dollar_arguments_pointer_p);
dollar_arguments_alloc = dollar_arguments_count;
- dollar_arguments_used = xmalloc (dollar_arguments_alloc);
- dollar_arguments_pointer_p = xmalloc (dollar_arguments_alloc);
+ dollar_arguments_used = XNEWVEC (char, dollar_arguments_alloc);
+ dollar_arguments_pointer_p = XNEWVEC (char, dollar_arguments_alloc);
}
if (dollar_arguments_alloc)
{
@@ -980,9 +980,10 @@ maybe_read_dollar_number (const char **format,
{
int nalloc;
nalloc = 2 * dollar_arguments_alloc + 16;
- dollar_arguments_used = xrealloc (dollar_arguments_used, nalloc);
- dollar_arguments_pointer_p = xrealloc (dollar_arguments_pointer_p,
- nalloc);
+ dollar_arguments_used = XRESIZEVEC (char, dollar_arguments_used,
+ nalloc);
+ dollar_arguments_pointer_p = XRESIZEVEC (char, dollar_arguments_pointer_p,
+ nalloc);
memset (dollar_arguments_used + dollar_arguments_alloc, 0,
nalloc - dollar_arguments_alloc);
dollar_arguments_alloc = nalloc;
@@ -1207,7 +1208,7 @@ static void
check_format_arg (void *ctx, tree format_tree,
unsigned HOST_WIDE_INT arg_num)
{
- format_check_context *format_ctx = ctx;
+ format_check_context *format_ctx = (format_check_context *) ctx;
format_check_results *res = format_ctx->res;
function_format_info *info = format_ctx->info;
tree params = format_ctx->params;
@@ -2307,7 +2308,8 @@ init_dynamic_asm_fprintf_info (void)
abort ();
/* Create a new (writable) copy of asm_fprintf_length_specs. */
- new_asm_fprintf_length_specs = xmemdup (asm_fprintf_length_specs,
+ new_asm_fprintf_length_specs = (format_length_info *)
+ xmemdup (asm_fprintf_length_specs,
sizeof (asm_fprintf_length_specs),
sizeof (asm_fprintf_length_specs));
@@ -2333,7 +2335,7 @@ static void
init_dynamic_diag_info (void)
{
static tree t, loc, hwi;
-
+
if (!loc || !t || !hwi)
{
static format_char_info *diag_fci, *cdiag_fci, *cxxdiag_fci;
@@ -2368,7 +2370,8 @@ init_dynamic_diag_info (void)
dynamic_format_types[gcc_diag_format_type].length_char_specs =
dynamic_format_types[gcc_cdiag_format_type].length_char_specs =
dynamic_format_types[gcc_cxxdiag_format_type].length_char_specs =
- diag_ls = xmemdup (gcc_diag_length_specs,
+ diag_ls = (format_length_info *)
+ xmemdup (gcc_diag_length_specs,
sizeof (gcc_diag_length_specs),
sizeof (gcc_diag_length_specs));
if (hwi)
@@ -2386,7 +2389,8 @@ init_dynamic_diag_info (void)
/* Handle the __gcc_diag__ format specifics. */
if (! diag_fci)
dynamic_format_types[gcc_diag_format_type].conversion_specs =
- diag_fci = xmemdup (gcc_diag_char_table,
+ diag_fci = (format_char_info *)
+ xmemdup (gcc_diag_char_table,
sizeof(gcc_diag_char_table),
sizeof(gcc_diag_char_table));
if (loc)
@@ -2405,7 +2409,8 @@ init_dynamic_diag_info (void)
/* Handle the __gcc_cdiag__ format specifics. */
if (! cdiag_fci)
dynamic_format_types[gcc_cdiag_format_type].conversion_specs =
- cdiag_fci = xmemdup (gcc_cdiag_char_table,
+ cdiag_fci = (format_char_info *)
+ xmemdup (gcc_cdiag_char_table,
sizeof(gcc_cdiag_char_table),
sizeof(gcc_cdiag_char_table));
if (loc)
@@ -2428,7 +2433,8 @@ init_dynamic_diag_info (void)
/* Handle the __gcc_cxxdiag__ format specifics. */
if (! cxxdiag_fci)
dynamic_format_types[gcc_cxxdiag_format_type].conversion_specs =
- cxxdiag_fci = xmemdup (gcc_cxxdiag_char_table,
+ cxxdiag_fci = (format_char_info *)
+ xmemdup (gcc_cxxdiag_char_table,
sizeof(gcc_cxxdiag_char_table),
sizeof(gcc_cxxdiag_char_table));
if (loc)
@@ -2530,7 +2536,7 @@ handle_format_attribute (tree *node, tree ARG_UNUSED (name), tree args,
/* Our first time through, we have to make sure that our
format_type data is allocated dynamically and is modifiable. */
if (!dynamic_format_types)
- format_types = dynamic_format_types =
+ format_types = dynamic_format_types = (format_kind_info *)
xmemdup (format_types_orig, sizeof (format_types_orig),
sizeof (format_types_orig));
diff --git a/gcc/c-lex.c b/gcc/c-lex.c
index 0e1473b13e7..091ec802d97 100644
--- a/gcc/c-lex.c
+++ b/gcc/c-lex.c
@@ -628,7 +628,7 @@ interpret_float (const cpp_token *token, unsigned int flags)
/* I or J suffix. */
copylen--;
- copy = alloca (copylen + 1);
+ copy = (char *) alloca (copylen + 1);
memcpy (copy, token->val.str.text, copylen);
copy[copylen] = '\0';
@@ -710,7 +710,7 @@ lex_string (const cpp_token *tok, tree *valp, bool objc_string)
}
}
while (tok->type == CPP_STRING || tok->type == CPP_WSTRING);
- strs = obstack_finish (&str_ob);
+ strs = (cpp_string *) obstack_finish (&str_ob);
}
/* We have read one more token than we want. */
diff --git a/gcc/c-pragma.c b/gcc/c-pragma.c
index 11e14be5157..563e2d7abdc 100644
--- a/gcc/c-pragma.c
+++ b/gcc/c-pragma.c
@@ -554,7 +554,7 @@ maybe_apply_renaming_pragma (tree decl, tree asmname)
const char *id = IDENTIFIER_POINTER (DECL_NAME (decl));
size_t ilen = IDENTIFIER_LENGTH (DECL_NAME (decl));
- char *newname = alloca (plen + ilen + 1);
+ char *newname = (char *) alloca (plen + ilen + 1);
memcpy (newname, prefix, plen);
memcpy (newname + plen, id, ilen + 1);
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index 0f4211c0e1f..9a41da62382 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -3598,7 +3598,7 @@ warn_for_assignment (const char *msgid, const char *opname, tree function,
{
/* Function name is known; supply it. */
const char *const argstring = _("passing arg of `%s'");
- new_opname = alloca (IDENTIFIER_LENGTH (function)
+ new_opname = (char *) alloca (IDENTIFIER_LENGTH (function)
+ strlen (argstring) + 1 + 1);
sprintf (new_opname, argstring,
IDENTIFIER_POINTER (function));
@@ -3607,7 +3607,7 @@ warn_for_assignment (const char *msgid, const char *opname, tree function,
{
/* Function name unknown (call through ptr). */
const char *const argnofun = _("passing arg of pointer to function");
- new_opname = alloca (strlen (argnofun) + 1 + 1);
+ new_opname = (char *) alloca (strlen (argnofun) + 1 + 1);
sprintf (new_opname, argnofun);
}
}
@@ -3615,7 +3615,7 @@ warn_for_assignment (const char *msgid, const char *opname, tree function,
{
/* Function name is known; supply it. */
const char *const argstring = _("passing arg %d of `%s'");
- new_opname = alloca (IDENTIFIER_LENGTH (function)
+ new_opname = (char *) alloca (IDENTIFIER_LENGTH (function)
+ strlen (argstring) + 1 + 25 /*%d*/ + 1);
sprintf (new_opname, argstring, argnum,
IDENTIFIER_POINTER (function));
@@ -3624,7 +3624,7 @@ warn_for_assignment (const char *msgid, const char *opname, tree function,
{
/* Function name unknown (call through ptr); just give arg number. */
const char *const argnofun = _("passing arg %d of pointer to function");
- new_opname = alloca (strlen (argnofun) + 1 + 25 /*%d*/ + 1);
+ new_opname = (char *) alloca (strlen (argnofun) + 1 + 25 /*%d*/ + 1);
sprintf (new_opname, argnofun, argnum);
}
opname = new_opname;
@@ -3849,7 +3849,7 @@ error_init (const char *msgid)
char *ofwhat;
error ("%s", _(msgid));
- ofwhat = print_spelling (alloca (spelling_length () + 1));
+ ofwhat = print_spelling ((char *) alloca (spelling_length () + 1));
if (*ofwhat)
error ("(near initialization for `%s')", ofwhat);
}
@@ -3864,7 +3864,7 @@ pedwarn_init (const char *msgid)
char *ofwhat;
pedwarn ("%s", _(msgid));
- ofwhat = print_spelling (alloca (spelling_length () + 1));
+ ofwhat = print_spelling ((char *) alloca (spelling_length () + 1));
if (*ofwhat)
pedwarn ("(near initialization for `%s')", ofwhat);
}
@@ -3879,7 +3879,7 @@ warning_init (const char *msgid)
char *ofwhat;
warning ("%s", _(msgid));
- ofwhat = print_spelling (alloca (spelling_length () + 1));
+ ofwhat = print_spelling ((char *) alloca (spelling_length () + 1));
if (*ofwhat)
warning ("(near initialization for `%s')", ofwhat);
}
diff --git a/gcc/defaults.h b/gcc/defaults.h
index e479affa4ef..763601c5f7a 100644
--- a/gcc/defaults.h
+++ b/gcc/defaults.h
@@ -67,7 +67,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#ifndef ASM_FORMAT_PRIVATE_NAME
# define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
do { const char *const name_ = (NAME); \
- char *const output_ = (OUTPUT) = alloca (strlen (name_) + 32);\
+ char *const output_ = (OUTPUT) = \
+ (char *) alloca (strlen (name_) + 32); \
sprintf (output_, ASM_PN_FORMAT, name_, (unsigned long)(LABELNO)); \
} while (0)
#endif
diff --git a/gcc/genconstants.c b/gcc/genconstants.c
index a49c5476d25..a4daa22027a 100644
--- a/gcc/genconstants.c
+++ b/gcc/genconstants.c
@@ -42,8 +42,8 @@ static int print_md_constant (void **, void *);
static int
print_md_constant (void **slot, void *info)
{
- struct md_constant *def = *slot;
- FILE *file = info;
+ struct md_constant *def = (struct md_constant *) *slot;
+ FILE *file = (FILE *) info;
fprintf (file, "#define %s %s\n", def->name, def->value);
return 1;
diff --git a/gcc/gengtype-lex.l b/gcc/gengtype-lex.l
index 8cff1bcb677..0c0c06d2f44 100644
--- a/gcc/gengtype-lex.l
+++ b/gcc/gengtype-lex.l
@@ -85,10 +85,11 @@ ITYPE {IWORD}({WS}{IWORD})*
is_pointer = 1;
for (namelen = 1; ISIDNUM (namestart[namelen]); namelen++)
;
- t = find_structure (xmemdup (tagstart, taglen, taglen+1), union_p);
+ t = find_structure ((const char *) xmemdup (tagstart, taglen, taglen+1),
+ union_p);
if (is_pointer)
t = create_pointer (t);
- namestart = xmemdup (namestart, namelen, namelen+1);
+ namestart = (char *) xmemdup (namestart, namelen, namelen+1);
#ifdef USE_MAPPED_LOCATION
/* temporary kludge - gentype doesn't handle cpp conditionals */
if (strcmp (namestart, "location_t") != 0
@@ -115,13 +116,14 @@ ITYPE {IWORD}({WS}{IWORD})*
ISSPACE(*typestart);
typestart++)
;
- for (typelen = namestart - typestart;
- ISSPACE(typestart[typelen-1]);
+ for (typelen = namestart - typestart;
+ ISSPACE (typestart[typelen-1]);
typelen--)
;
t = create_scalar_type (typestart, typelen);
- do_typedef (xmemdup (namestart, namelen, namelen+1), t, &lexer_line);
+ do_typedef ((const char *) xmemdup (namestart, namelen, namelen+1), t,
+ &lexer_line);
update_lineno (yytext, yyleng);
}
@@ -137,7 +139,8 @@ ITYPE {IWORD}({WS}{IWORD})*
namestart -= namelen - 1;
t = create_scalar_type ("function type", sizeof ("function type")-1);
- do_typedef (xmemdup (namestart, namelen, namelen+1), t, &lexer_line);
+ do_typedef ((const char *) xmemdup (namestart, namelen, namelen+1), t,
+ &lexer_line);
update_lineno (yytext, yyleng);
}
@@ -153,7 +156,8 @@ ITYPE {IWORD}({WS}{IWORD})*
namestart -= namelen - 1;
t = create_scalar_type ("function type", sizeof ("function type")-1);
- do_typedef (xmemdup (namestart, namelen, namelen+1), t, &lexer_line);
+ do_typedef ((const char *) xmemdup (namestart, namelen, namelen+1), t,
+ &lexer_line);
update_lineno (yytext, yyleng);
}
@@ -169,7 +173,8 @@ ITYPE {IWORD}({WS}{IWORD})*
namestart -= namelen - 1;
t = create_scalar_type ("function type", sizeof ("function type")-1);
- do_typedef (xmemdup (namestart, namelen, namelen+1), t, &lexer_line);
+ do_typedef ((const char *) xmemdup (namestart, namelen, namelen+1), t,
+ &lexer_line);
update_lineno (yytext, yyleng);
}
@@ -185,7 +190,8 @@ ITYPE {IWORD}({WS}{IWORD})*
namestart -= namelen - 1;
t = create_scalar_type ("function type", sizeof ("function type")-1);
- do_typedef (xmemdup (namestart, namelen, namelen+1), t, &lexer_line);
+ do_typedef ((const char *) xmemdup (namestart, namelen, namelen+1), t,
+ &lexer_line);
update_lineno (yytext, yyleng);
}
@@ -211,7 +217,9 @@ ITYPE {IWORD}({WS}{IWORD})*
for (taglen = 1; ISIDNUM (tagstart[taglen]); taglen++)
;
- yylval.t = find_structure (xmemdup (tagstart, taglen, taglen + 1), union_p);
+ yylval.t = find_structure ((const char *) xmemdup (tagstart, taglen,
+ taglen + 1),
+ union_p);
BEGIN(in_struct);
update_lineno (yytext, yyleng);
return typedef_p ? ENT_TYPEDEF_STRUCT : ENT_STRUCT;
@@ -251,7 +259,7 @@ ITYPE {IWORD}({WS}{IWORD})*
push_macro_expansion (macro, macro_len, arg, arg_len);
/* Create the struct and typedef. */
- ptr = xmemdup ("VEC_", 4, 4 + arg_len + 1);
+ ptr = (char *) xmemdup ("VEC_", 4, 4 + arg_len + 1);
memcpy (&ptr[4], arg, arg_len);
ptr[4 + arg_len] = 0;
t = find_structure (ptr, 0);
@@ -276,8 +284,8 @@ ITYPE {IWORD}({WS}{IWORD})*
"ptr_alias"/[^[:alnum:]_] { return ALIAS; }
"nested_ptr"/[^[:alnum:]_] { return NESTED_PTR; }
[0-9]+ { return NUM; }
-"param"[0-9]*"_is"/[^[:alnum:]_] {
- yylval.s = xmemdup (yytext, yyleng, yyleng+1);
+"param"[0-9]*"_is"/[^[:alnum:]_] {
+ yylval.s = (const char *) xmemdup (yytext, yyleng, yyleng+1);
return PARAM_IS;
}
@@ -308,7 +316,7 @@ ITYPE {IWORD}({WS}{IWORD})*
while (*ptr != ')' && !ISSPACE (*ptr))
ptr++;
arg_len = ptr - arg;
- ptr = xmemdup (macro, macro_len, macro_len + arg_len + 2);
+ ptr = (char *) xmemdup (macro, macro_len, macro_len + arg_len + 2);
ptr[macro_len] = '_';
memcpy (&ptr[macro_len+1], arg, arg_len);
yylval.s = ptr;
@@ -316,24 +324,24 @@ ITYPE {IWORD}({WS}{IWORD})*
}
{ID}/[^[:alnum:]_] {
- yylval.s = xmemdup (yytext, yyleng, yyleng+1);
+ yylval.s = (const char *) xmemdup (yytext, yyleng, yyleng+1);
return ID;
}
\"([^"\\]|\\.)*\" {
- yylval.s = xmemdup (yytext+1, yyleng-2, yyleng-1);
+ yylval.s = (const char *) xmemdup (yytext+1, yyleng-2, yyleng-1);
return STRING;
}
"["[^\[\]]*"]" {
- yylval.s = xmemdup (yytext+1, yyleng-2, yyleng-1);
+ yylval.s = (const char *) xmemdup (yytext+1, yyleng-2, yyleng-1);
return ARRAY;
}
^"%"{ID} {
- yylval.s = xmemdup (yytext+1, yyleng-1, yyleng);
+ yylval.s = (const char *) xmemdup (yytext+1, yyleng-1, yyleng);
return PERCENT_ID;
}
"'"("\\".|[^\\])"'" {
- yylval.s = xmemdup (yytext+1, yyleng-2, yyleng);
+ yylval.s = (const char *) xmemdup (yytext+1, yyleng-2, yyleng);
return CHAR;
}
diff --git a/gcc/genmodes.c b/gcc/genmodes.c
index 2a3bb6ccc88..fc5dc9b4169 100644
--- a/gcc/genmodes.c
+++ b/gcc/genmodes.c
@@ -703,7 +703,7 @@ calc_wider_mode (void)
/* Allocate max_n_modes + 1 entries to leave room for the extra null
pointer assigned after the qsort call below. */
- sortbuf = alloca ((max_n_modes + 1) * sizeof (struct mode_data *));
+ sortbuf = (struct mode_data **) alloca ((max_n_modes + 1) * sizeof (struct mode_data *));
for (c = 0; c < MAX_MODE_CLASS; c++)
{
diff --git a/gcc/read-rtl.c b/gcc/read-rtl.c
index 3252a0fcd9f..46ca61a188d 100644
--- a/gcc/read-rtl.c
+++ b/gcc/read-rtl.c
@@ -191,7 +191,7 @@ read_name (char *str, FILE *infile)
struct md_constant tmp_def;
tmp_def.name = p;
- def = htab_find (md_constants, &tmp_def);
+ def = (struct md_constant *) htab_find (md_constants, &tmp_def);
if (def)
p = def->value;
} while (def);
@@ -277,7 +277,7 @@ read_quoted_string (struct obstack *ob, FILE *infile)
}
obstack_1grow (ob, 0);
- return obstack_finish (ob);
+ return (char *) obstack_finish (ob);
}
/* Read a braced string (a la Tcl) onto the obstack. Caller has
@@ -315,7 +315,7 @@ read_braced_string (struct obstack *ob, FILE *infile)
}
obstack_1grow (ob, 0);
- return obstack_finish (ob);
+ return (char *) obstack_finish (ob);
}
/* Read some kind of string constant. This is the high-level routine
@@ -455,7 +455,7 @@ read_constants (FILE *infile, char *tmp_char)
}
else
{
- def = *entry_ptr;
+ def = (struct md_constant *) *entry_ptr;
if (strcmp (def->value, tmp_char))
fatal_with_file_and_line (infile,
"redefinition of %s, was %s, now %s",
diff --git a/gcc/rtl.c b/gcc/rtl.c
index 3c03ae2924b..533b2f12274 100644
--- a/gcc/rtl.c
+++ b/gcc/rtl.c
@@ -177,7 +177,8 @@ rtx_alloc_stat (RTX_CODE code MEM_STAT_DECL)
{
rtx rt;
- rt = ggc_alloc_typed_stat (gt_ggc_e_7rtx_def, RTX_SIZE (code) PASS_MEM_STAT);
+ rt = (rtx) ggc_alloc_typed_stat (gt_ggc_e_7rtx_def,
+ RTX_SIZE (code) PASS_MEM_STAT);
/* We want to clear everything up to the FLD array. Normally, this
is one int, but we don't want to assume that and it isn't very
@@ -311,8 +312,8 @@ shallow_copy_rtx_stat (rtx orig MEM_STAT_DECL)
{
rtx copy;
- copy = ggc_alloc_typed_stat (gt_ggc_e_7rtx_def, RTX_SIZE (GET_CODE (orig))
- PASS_MEM_STAT);
+ copy = (rtx) ggc_alloc_typed_stat (gt_ggc_e_7rtx_def,
+ RTX_SIZE (GET_CODE (orig)) PASS_MEM_STAT);
memcpy (copy, orig, RTX_SIZE (GET_CODE (orig)));
return copy;
}