Commit c5e36c09 by Zack Weinberg

Zack Weinberg <zack@codesourcery.com

2004-07-24  Alexander Kabaev  <kan@freebsd.org>
	    Zack Weinberg  <zack@codesourcery.com

	PR 16684
	* c-decl.c (diagnose_mismatched_decls): Don't issue a
	redundant-declaration warning the first time a builtin is
	declared explicitly.
testsuite:
	* gcc.dg/Wredundant-decls-1.c: New test case.

From-SVN: r85140
parent 9d55a966
2004-07-24 Alexander Kabaev <kan@freebsd.org>
Zack Weinberg <zack@codesourcery.com
PR 16684
* c-decl.c (diagnose_mismatched_decls): Don't issue a
redundant-declaration warning the first time a builtin is
declared explicitly.
2004-07-25 Bernardo Innocenti <bernie@develer.com> 2004-07-25 Bernardo Innocenti <bernie@develer.com>
* tree.h (staticp): Change return type to bool. * tree.h (staticp): Change return type to bool.
......
...@@ -1444,6 +1444,11 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl, ...@@ -1444,6 +1444,11 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl,
definition. */ definition. */
&& !(TREE_CODE (newdecl) == FUNCTION_DECL && !(TREE_CODE (newdecl) == FUNCTION_DECL
&& DECL_INITIAL (newdecl) && !DECL_INITIAL (olddecl)) && 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. */ /* Don't warn about an extern followed by a definition. */
&& !(DECL_EXTERNAL (olddecl) && !DECL_EXTERNAL (newdecl)) && !(DECL_EXTERNAL (olddecl) && !DECL_EXTERNAL (newdecl))
/* Don't warn about forward parameter decls. */ /* Don't warn about forward parameter decls. */
......
2004-07-24 Zack Weinberg <zack@codesourcery.com>
PR 16684
* gcc.dg/Wredundant-decls-1.c: New test case.
2004-07-24 Jakub Jelinek <jakub@redhat.com> 2004-07-24 Jakub Jelinek <jakub@redhat.com>
* README.compat: Add RUN_ALL_COMPAT_TESTS documentation. * README.compat: Add RUN_ALL_COMPAT_TESTS documentation.
......
/* 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" } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment