mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-01-27 10:03:58 +08:00
toplev.c (check_global_declarations): Suppress not-used warning for volatile variables.
2003-05-05 Geoffrey Keating <geoffk@apple.com> * toplev.c (check_global_declarations): Suppress not-used warning for volatile variables. Index: testsuite/ChangeLog 2003-05-05 Geoffrey Keating <geoffk@apple.com> * gcc.dg/unused-5.c: New test. From-SVN: r66493
This commit is contained in:
parent
9e5f281f99
commit
36b29d7dd1
@ -1,3 +1,8 @@
|
||||
2003-05-05 Geoffrey Keating <geoffk@apple.com>
|
||||
|
||||
* toplev.c (check_global_declarations): Suppress not-used warning
|
||||
for volatile variables.
|
||||
|
||||
2003-05-05 Olivier Hainque <hainque@act-europe.fr>
|
||||
|
||||
* expr.c (expand_expr, case BIT_FIELD_REF): Refine the test forcing
|
||||
|
@ -1,3 +1,7 @@
|
||||
2003-05-05 Geoffrey Keating <geoffk@apple.com>
|
||||
|
||||
* gcc.dg/unused-5.c: New test.
|
||||
|
||||
2003-05-05 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
|
||||
|
||||
PR c++/10496
|
||||
|
8
gcc/testsuite/gcc.dg/unused-5.c
Normal file
8
gcc/testsuite/gcc.dg/unused-5.c
Normal file
@ -0,0 +1,8 @@
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-Wunused" } */
|
||||
/* { dg-final { scan-assembler "string_to_look_for" } } */
|
||||
|
||||
/* 'volatile' variables get output and don't produce a warning about being
|
||||
unused. */
|
||||
static volatile char string[]
|
||||
= "string_to_look_for"; /* { dg-bogus "not used" } */
|
@ -2132,6 +2132,8 @@ check_global_declarations (vec, len)
|
||||
&& ! TREE_USED (DECL_NAME (decl))
|
||||
&& ! DECL_EXTERNAL (decl)
|
||||
&& ! TREE_PUBLIC (decl)
|
||||
/* A volatile variable might be used in some non-obvious way. */
|
||||
&& ! TREE_THIS_VOLATILE (decl)
|
||||
/* Global register variables must be declared to reserve them. */
|
||||
&& ! (TREE_CODE (decl) == VAR_DECL && DECL_REGISTER (decl))
|
||||
/* Otherwise, ask the language. */
|
||||
|
Loading…
Reference in New Issue
Block a user