From: Richard Stallman Date: Mon, 29 Jun 1992 04:26:19 +0000 (+0000) Subject: (initializer_constant_valid_p): Allow CONVERT_EXPR if its operand is ok. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a4219ac7406c41efb439fa8690b634291f7a9d53;p=gcc.git (initializer_constant_valid_p): Allow CONVERT_EXPR if its operand is ok. (build_c_cast): For cast to union, make a CONSTRUCTOR. From-SVN: r1331 --- diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 77c890c2f7e..4db8fbd7007 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -1227,6 +1227,23 @@ duplicate_decls (newdecl, olddecl) TREE_THIS_VOLATILE (newdecl) |= TREE_THIS_VOLATILE (olddecl); } } + /* Permit char *foo () to match void *foo (...) if not pedantic. */ + else if (!types_match + && TREE_CODE (olddecl) == FUNCTION_DECL + && TREE_CODE (newdecl) == FUNCTION_DECL + && TREE_CODE (TREE_TYPE (olddecl)) == POINTER_TYPE + && TREE_CODE (TREE_TYPE (newdecl)) == POINTER_TYPE + && ((TREE_TYPE (TREE_TYPE (newdecl)) == void_type_node + && TYPE_ARG_TYPES (TREE_TYPE (olddecl)) == 0 + && TREE_TYPE (TREE_TYPE (olddecl)) == char_type_node) + || + (TREE_TYPE (TREE_TYPE (newdecl)) == char_type_node + && TYPE_ARG_TYPES (TREE_TYPE (newdecl)) == 0 + && TREE_TYPE (TREE_TYPE (olddecl)) == void_type_node))) + { + if (pedantic) + pedwarn_with_decl (newdecl, "conflicting types for `%s'"); + } else if (!types_match /* Permit char *foo (int, ...); followed by char *foo (); if not pedantic. */