Commit 29128154 by Andrew Pinski Committed by Andrew Pinski

PR c/17178, PR c/17820

2004-10-03  Andrew Pinski  <pinskia@physics.uc.edu>

        PR c/17178, PR c/17820
        * c-decl.c (pop_scope): Do not warn about unused static
        variables as they warned in the middle-end.

2004-10-03  Andrew Pinski  <pinskia@physics.uc.edu>

        PR c/17178
        * gcc.dg/unused-4.c: Adjust to be correct.

        PR c/17820
        * gcc.dg/unused-7.c: New test.

From-SVN: r88467
parent ef7eaebf
2004-10-03 Andrew Pinski <pinskia@physics.uc.edu>
PR c/17178, PR c/17820
* c-decl.c (pop_scope): Do not warn about unused static
variables as they warned in the middle-end.
2004-10-03 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* builtins.c (expand_builtin_memcpy): Delete duplicate code
......
......@@ -767,10 +767,8 @@ pop_scope (void)
&& !DECL_IN_SYSTEM_HEADER (p)
&& DECL_NAME (p)
&& !DECL_ARTIFICIAL (p)
&& (scope != file_scope
|| (TREE_STATIC (p) && !TREE_PUBLIC (p)
&& !TREE_THIS_VOLATILE (p)))
&& scope != external_scope)
&& scope != file_scope
&& scope != external_scope)
warning ("%Junused variable %qD", p, p);
if (b->inner_comp)
......
2004-10-03 Andrew Pinski <pinskia@physics.uc.edu>
PR c/17178
* gcc.dg/unused-4.c: Adjust to be correct.
PR c/17820
* gcc.dg/unused-7.c: New test.
2004-10-03 Andrew Pinski <pinskia@physics.uc.edu>
PR c++/17797
* g++.dg/overload/template2.C: New test.
......
/* { dg-do compile } */
/* { dg-options "-Wunused -O3" } */
static const int i = 0; /* { dg-warning "unused variable" } */
static const int i = 0;
static void f() { } /* { dg-warning "defined but not used" } */
static inline void g() { }
/* { dg-do compile } */
/* { dg-options "-Wunused-parameter" } */
static int a = 10; /* { dg-warning "defined but not used" } */
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