Article View: gnu.gcc.help
Article #51503Avoiding a warning for an "unused" sccs id
From: Rob Cunningham
Date: Wed, 12 May 1993 10:12
Date: Wed, 12 May 1993 10:12
32 lines
1915 bytes
1915 bytes
In order to identify library files, I include a static sccs variable in the
top of that file. This variable is filled in with a version number and a date
by sccs when the file is used to make a library. Unfortunately, gcc always
issues a warning when it sees the variable during the compilation process.
The warning is:
<filename>.c:10: warning: `id' defined but not used
For an earlier version of gcc, someone suggested that I do the following:
static char sccs [] = "%W% %H%";
USE (sccs); /* Avoid a gcc warning */
where USE is defined as:
/* This prevents a warning from gcc when using an sccs variable */
#define USE(var) \
static struct use_##var { struct use_##var *round; void **ptr; }\
use_##var = { &use_##var, (void *) &var }
But this doesn't seem to work with gcc version 2.2.2 (don't yet know if it
works again in a later version). Can someone suggest a new macro that will
remove this warning?
-Rob
--
Robert K. Cunningham
rkc@xn.ll.mit.edu
Machine Intelligence Group Cognitive and Neural Systems Dept.
MIT Lincoln Laboratory Boston University (Occasionally)
(617)-981-2584 (617)-353-5235
Technical Details
Message-ID:
<RKC.93May12101222@tremor.mi.ll.mit.edu>Path:
arc1-ca.pugleaf.net!gmd.de!ira.uka.de!math.fu-berlin.de!mailgzrz.TU-Berlin.DE!news.netmbx.de!Germany.EU.net!mcsun!uunet!europa.eng.gtefsd.com!darwin.sura.net!bogus.sura.net!udel!rochester!cornell!uw-beaver!uhog.mit.edu!xn.ll.mit.edu!rkcShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,13cebee1696034f3,start X-Google-Attributes: gid11318c,public X-Google-ArrivalTime: 1993-05-12 07:48:46 PST Newsgroups: gnu.gcc.help Path: arc1-ca.pugleaf.net!gmd.de!ira.uka.de!math.fu-berlin.de!mailgzrz.TU-Berlin.DE!news.netmbx.de!Germany.EU.net!mcsun!uunet!europa.eng.gtefsd.com!darwin.sura.net!bogus.sura.net!udel!rochester!cornell!uw-beaver!uhog.mit.edu!xn.ll.mit.edu!rkc From: rkc@tremor.mi.ll.mit.edu (Rob Cunningham) Subject: Avoiding a warning for an "unused" sccs id Message-ID: <RKC.93May12101222@tremor.mi.ll.mit.edu> Sender: usenet@xn.ll.mit.edu Reply-To: rkc@xn.ll.mit.edu Organization: MIT Lincoln Laboratory Distribution: gnu Date: 12 May 93 10:12:22 Lines: 32