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
+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
+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
--- /dev/null
+/* { 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" } */
&& ! 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. */