diff options
author | Richard Stallman <rms@gnu.org> | 1992-07-07 02:11:08 +0000 |
---|---|---|
committer | Richard Stallman <rms@gnu.org> | 1992-07-07 02:11:08 +0000 |
commit | 592252adb8d84c69f69c7003913dcd02359b06c3 (patch) | |
tree | 1f48910d24166ebfce0b58603d69f01460e2f759 /gcc | |
parent | 18a799ccb176bd83fbabe18444107142a4802b2e (diff) | |
download | gcc-592252adb8d84c69f69c7003913dcd02359b06c3.zip gcc-592252adb8d84c69f69c7003913dcd02359b06c3.tar.gz gcc-592252adb8d84c69f69c7003913dcd02359b06c3.tar.bz2 |
(duplicate_decls): Let char *foo () match void *foo ()
only if one of them came from a system header file.
From-SVN: r1495
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/c-decl.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 34c4e10..ca335e5 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)) |