From c5e36c09e5df095a140f98e064d14759a09e1108 Mon Sep 17 00:00:00 2001 From: Zack Weinberg Date: Sun, 25 Jul 2004 03:58:50 +0000 Subject: [PATCH] Zack Weinberg Zack Weinberg + Zack Weinberg * tree.h (staticp): Change return type to bool. diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 65fd24d02cb..41e7df0c01a 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -1444,6 +1444,11 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl, definition. */ && !(TREE_CODE (newdecl) == FUNCTION_DECL && DECL_INITIAL (newdecl) && !DECL_INITIAL (olddecl)) + /* Don't warn about redundant redeclarations of builtins. */ + && !(TREE_CODE (newdecl) == FUNCTION_DECL + && !DECL_BUILT_IN (newdecl) + && DECL_BUILT_IN (olddecl) + && !C_DECL_DECLARED_BUILTIN (olddecl)) /* Don't warn about an extern followed by a definition. */ && !(DECL_EXTERNAL (olddecl) && !DECL_EXTERNAL (newdecl)) /* Don't warn about forward parameter decls. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index bc7d6f6ce78..8c9515942eb 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2004-07-24 Zack Weinberg + + PR 16684 + * gcc.dg/Wredundant-decls-1.c: New test case. + 2004-07-24 Jakub Jelinek * README.compat: Add RUN_ALL_COMPAT_TESTS documentation. @@ -58,7 +63,7 @@ 2004-07-22 David Billinghurst (David.Billinghurst@riotinto.com) - * gfortran.dg/g77/970625-2.f Copy from g77.f-torture/execute. + * gfortran.dg/g77/970625-2.f Copy from g77.f-torture/execute. Add dg-run directive. Declare variables as required. * gfortran.dg/g77/README: Update @@ -112,7 +117,7 @@ 2004-07-21 David Billinghurst (David.Billinghurst@riotinto.com) Copy cases from g77.f-torture/execute and add dg-run - directive. Other changes as noted. + directive. Other changes as noted. * gfortran.dg/g77/13037.f * gfortran.dg/g77/1832.f * gfortran.dg/g77/19981119-0.f @@ -184,7 +189,7 @@ g++.dg/parse/casting-operator2.C, g++.dg/parse/dtor3.C, g++.dg/parse/typename6.C, g++.dg/template/dependent-expr4.C, g++.dg/template/nontype3.C: Remove trailing CR from tests. - + 2004-07-18 Mark Mitchell PR c++/16623 @@ -298,7 +303,7 @@ PR c++/16518 * g++.dg/parse/mutable1.C: New test. - + 2004-07-13 Diego Novillo PR tree-optimization/16443 @@ -312,7 +317,7 @@ 2004-07-13 David Billinghurst * gfortran.dg/g77/README: New file - * gfortran.dg/g77/19981216-0.f: Copy from + * gfortran.dg/g77/19981216-0.f: Copy from g77.f-torture/noncompile. Add "dg-do compile" and dg-error as required. * gfortran.dg/g77/19990218-1.f: Likewise @@ -334,12 +339,12 @@ * gfortran.dg/g77/970125-0.f: Add dg-excess-errors. * gfortran.dg/g77/980519-2.f: Declare hd_S,hd_Z,hd_T * gfortran.dg/g77/990115-1.f: Declare RANK as INTEGER - * gfortran.dg/g77/alpha1.f: Separate declaration and DATA - statement to conform to standard. Append alpha1.x for reference. + * gfortran.dg/g77/alpha1.f: Separate declaration and DATA + statement to conform to standard. Append alpha1.x for reference. * gfortran.dg/g77/xformat.f: Add dg-warning 2004-07-13 David Billinghurst - + * gfortran.dg/g77/cpp.F: Copy from g77.f-torture/compile. Add {dg-do compile} directive. * gfortran.dg/g77/cpp2.F: Likewise @@ -361,7 +366,7 @@ * g++.old-deja/g++.ns/new1.C: Remove (ill-formed). 2004-07-12 David Billinghurst - + * gfortran.dg/g77/12002.f: Copy from g77.f-torture/compile. Add {dg-do compile} directive. * gfortran.dg/g77/13060.f: Likewise @@ -428,14 +433,14 @@ PR fortran/17574 * gfortran.dg/pr15754.f90: New test. - + 2004-07-11 Joseph S. Myers PR tree-optimization/16437 * gcc.c-torture/execute/bitfld-4.c: New test. 2004-07-10 Tobias Schlueter - + * gfortran.fortran-torture/execute/common_2.f90: Add check for access to common var from module. @@ -465,7 +470,7 @@ * gfortran.dg/g77/pr9258.f: Likewise. Add dg-warning lines. 2004-07-10 Tobias Schlueter - + * gfortran.fortran-torture/execute/module_init_1.f90: Fix test. 2004-07-10 Tobias Schlueter @@ -484,7 +489,7 @@ * gcc.c-torture/compile/20040709-1.c: New. 2004-07-09 Tobias Schlueter - + PR fortran/14077 * gfortran.fortran-torture/execute/module_init_1.f90: New test. diff --git a/gcc/testsuite/gcc.dg/Wredundant-decls-1.c b/gcc/testsuite/gcc.dg/Wredundant-decls-1.c new file mode 100644 index 00000000000..c38c7b5540f --- /dev/null +++ b/gcc/testsuite/gcc.dg/Wredundant-decls-1.c @@ -0,0 +1,7 @@ +/* PR 16684: no redundant declaration warnings should issue the first + time a built-in function is declared. + { dg-do compile } + { dg-options "-Wredundant-decls" } */ + +void *malloc (__SIZE_TYPE__); /* { dg-bogus "redundant" } */ +void *malloc (__SIZE_TYPE__); /* { dg-warning "redundant" } */ -- 2.30.2