Commit 32436219 by Richard Stallman

(duplicate_decls): For builtins, create new function

type instead of trying to modify old one.

(c_decode_option): Decode -Wreturn-type.

From-SVN: r2794
parent 8adfad0f
...@@ -1305,10 +1305,15 @@ duplicate_decls (newdecl, olddecl) ...@@ -1305,10 +1305,15 @@ duplicate_decls (newdecl, olddecl)
tree newreturntype = TREE_TYPE (TREE_TYPE (newdecl)); tree newreturntype = TREE_TYPE (TREE_TYPE (newdecl));
if (TYPE_MODE (oldreturntype) == TYPE_MODE (newreturntype)) if (TYPE_MODE (oldreturntype) == TYPE_MODE (newreturntype))
{ {
TREE_TYPE (TREE_TYPE (olddecl)) = newreturntype; /* Function types may be shared, so we can't just modify
types_match = comptypes (TREE_TYPE (newdecl), TREE_TYPE (olddecl)); the return type of olddecl's function type. */
if (!types_match) tree newtype
TREE_TYPE (TREE_TYPE (olddecl)) = oldreturntype; = build_function_type (newreturntype,
TYPE_ARG_TYPES (TREE_TYPE (olddecl)));
types_match = comptypes (TREE_TYPE (newdecl), newtype);
if (types_match)
TREE_TYPE (olddecl) = newtype;
} }
} }
if (!types_match) if (!types_match)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment