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: Marc Espie <espie at quatramaran dot ens dot fr>
- To: gcc at gcc dot gnu dot org
- Cc:
- Date: Thu, 1 May 2003 13:00:21 +0200
- Subject: Re: GCC warnings for unused global variables
- Organization: Ecole Normale Superieure (quatramaran)
- References: <20030429165657.634a1628.ak03@gte.com>
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.
Also, this kind of thing is pervasive in older code.
And warning on perfectly legal, innocuous constructs makes
absolutely no sense to me.
Using static char * variables (lately, const char *) to embed
version strings in files has been current practice over the last
twenty years or so. Why break it now ?