Hi, Changes:
* c/c-decl.c (pop_scope): Skip volatile variables while emit warnings for unused variables. Tested on i686-pc-linux-gnu. OK? Mingjie
Index: gcc/c/c-decl.c =================================================================== --- gcc/c/c-decl.c (revision 204285) +++ gcc/c/c-decl.c (working copy) @@ -1183,6 +1183,8 @@ pop_scope (void) && !DECL_IN_SYSTEM_HEADER (p) && DECL_NAME (p) && !DECL_ARTIFICIAL (p) + /* A volatile variable might be used in some non-obvious way. */ + && !TREE_THIS_VOLATILE (p) && scope != file_scope && scope != external_scope) {