Article View: gnu.gcc.help
Article #42371How to compile in RCS identifiers?
From: James_Mathiesen
Date: Fri, 15 Dec 1995 00:00
Date: Fri, 15 Dec 1995 00:00
21 lines
1098 bytes
1098 bytes
I'm trying to figure out how to best include RCS version identifier
strings into the various modules I'm compiling with gcc. I've been
running into two problems.
1) With -Wall the compiler warns about the variable being unused
2) The compiler optimizes away the existence of the string
This is as far as I got:
#ifdef __GNUG__
static char rcsid[] __attribute__ ((unused)) =
#else
static char rcsid[] =
#endif
"$Id: CParser.cc,v 1.3 1995/12/11 21:57:30 lbin Exp $";
However the ((unused)) attribute appears to be new in gcc 2.7.0. Is
there some other way of doing this which is likely to work across
more versions of gcc and/or more compilers?
james
Technical Details
Message-ID:
<4as6dg$3ih@ets.cis.brown.edu>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,64570f4dd695fd36,start X-Google-Attributes: gid11318c,public From: james@ets.cis.brown.edu (James_Mathiesen) Subject: How to compile in RCS identifiers? Date: 1995/12/15 Message-ID: <4as6dg$3ih@ets.cis.brown.edu> X-Deja-AN: 121954551 organization: Brown University -- Providence, Rhode Island USA newsgroups: gnu.gcc.help