(duplicate_decls): Let char *foo () match void *foo ()

only if one of them came from a system header file.

From-SVN: r1495
This commit is contained in:
Richard Stallman 1992-07-07 02:11:08 +00:00
parent 18a799ccb1
commit 592252adb8

View File

@ -1249,12 +1249,15 @@ duplicate_decls (newdecl, olddecl)
TREE_THIS_VOLATILE (newdecl) |= TREE_THIS_VOLATILE (olddecl);
}
}
/* Permit char *foo () to match void *foo (...) if not pedantic. */
/* Permit char *foo () to match void *foo (...) if not pedantic,
if one of them came from a system header file. */
else if (!types_match
&& TREE_CODE (olddecl) == FUNCTION_DECL
&& TREE_CODE (newdecl) == FUNCTION_DECL
&& TREE_CODE (TREE_TYPE (oldtype)) == POINTER_TYPE
&& TREE_CODE (TREE_TYPE (newtype)) == POINTER_TYPE
&& (DECL_IN_SYSTEM_HEADER (olddecl)
|| DECL_IN_SYSTEM_HEADER (newdecl))
&& ((TREE_TYPE (TREE_TYPE (newtype)) == void_type_node
&& TYPE_ARG_TYPES (oldtype) == 0
&& self_promoting_args_p (TYPE_ARG_TYPES (newtype))