GCC warnings for unused global variables
Alexander Kabaev
ak03@gte.com
Wed Apr 30 00:51:00 GMT 2003
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
More information about the Gcc
mailing list