]> gcc.gnu.org Git - gcc.git/commitdiff
(duplicate_decls): Let char *foo () match void *foo ()
authorRichard Stallman <rms@gnu.org>
Tue, 7 Jul 1992 02:11:08 +0000 (02:11 +0000)
committerRichard Stallman <rms@gnu.org>
Tue, 7 Jul 1992 02:11:08 +0000 (02:11 +0000)
only if one of them came from a system header file.

From-SVN: r1495

gcc/c-decl.c

index 34c4e1050e4dfb0ff013ee1b22ba0b63d290826c..ca335e5e1bcda0b8aa57e1050dff13940ee84775 100644 (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))
This page took 0.06388 seconds and 5 git commands to generate.