diff options
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r-- | gcc/c-decl.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 746fa47..ea7942c 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -1548,6 +1548,22 @@ duplicate_decls (newdecl, olddecl, different_binding_level) if (! different_binding_level) TREE_TYPE (olddecl) = oldtype; } + else if (TYPE_ARG_TYPES (oldtype) == NULL + && TYPE_ARG_TYPES (newtype) != NULL) + { + /* For bcmp, bzero, fputs the builtin type has arguments not + specified. Use the ones from the prototype so that type checking + is done for them. */ + tree trytype + = build_function_type (TREE_TYPE (oldtype), + TYPE_ARG_TYPES (newtype)); + trytype = build_type_attribute_variant (trytype, + TYPE_ATTRIBUTES (oldtype)); + + oldtype = trytype; + if (! different_binding_level) + TREE_TYPE (olddecl) = oldtype; + } if (!types_match) { /* If types don't match for a built-in, throw away the built-in. */ |