This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: GCC warnings for unused global variables
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Marc Espie <espie at quatramaran dot ens dot fr>
- Cc: gcc at gcc dot gnu dot org
- Date: 02 May 2003 14:43:53 +0200
- Subject: Re: GCC warnings for unused global variables
- Organization: Integrable Solutions
- References: <20030429165657.634a1628.ak03@gte.com><200305011100.h41B0L831774@quatramaran.ens.fr>
Marc Espie <espie@quatramaran.ens.fr> writes:
| In article <20030430083713.GU4016@paradies.suse.de> you write:
| >* Alexander Kabaev (ak03@gte.com) [20030429 22:57]:
| >
| >> #ifndef lint
| >> static const char rcsid[] =
| >> "$Id: src/dir/file.c 1.12 1999/08/27 23:45:12 me Exp$";
| >> #endif /* not lint */
| >
| >Why not just use __attribute__((__unused__))?
| >
| >Philipp
|
| Because it's a gcc extension, so writing portable code that
| uses it will require some more machinery, hence more clutter.
You cannot argue at the same time for portable code and having or not
having diagnostics, which are by definition, implementation defined.
At the very point you start elaborating about diagnostics, you
accept implementation defined semantics and constructs, hence "writing
portable code" cannot be the decisive argument. It ought to be
something else.
FWIW, I'm not convinced by the "it is a regression" argument, that is
streching the notion of "regression". If we want to take that route,
then we should stop fixing bugs in the compilers because fixing bugs
means removing (or adding) something that was (or weren't) there before.
-- Gaby