This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
GCC warnings for unused global variables
- From: Alexander Kabaev <ak03 at gte dot com>
- To: gcc at gcc dot gnu dot org
- Date: Tue, 29 Apr 2003 16:56:57 -0400
- Subject: GCC warnings for unused global variables
- Organization: Verizon Data Services
I noticed that GCC 3.3 differs slightly from GCC 3.2 in regards of
unused static variable warning emission. GCC 3.2 used to ignore
unused static constant variables in both C and C++ frontends before, now
it only does that for C++. Unfortunately, this means that the
following common C code snippet now generates a warning:
#ifndef lint
static const char rcsid[] =
"$Id: src/dir/file.c 1.12 1999/08/27 23:45:12 me Exp$";
#endif /* not lint */
I wonder if the old behavior can be restored or a new -W flag can be
introduced to disable unused warning for such variables? The flag should
pretty trivial to implement.
--
Alexander Kabaev