From: Richard Stallman Date: Tue, 7 Jul 1992 02:11:08 +0000 (+0000) Subject: (duplicate_decls): Let char *foo () match void *foo () X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=592252adb8d84c69f69c7003913dcd02359b06c3;p=gcc.git (duplicate_decls): Let char *foo () match void *foo () only if one of them came from a system header file. From-SVN: r1495 --- diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 34c4e1050e4..ca335e5e1bc 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -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))