🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #52189

Re: SCCS strings embedded in code with -Wall

#52189
From: Paul Eggert
Date: Sat, 16 Jan 1993 18:25
15 lines
1329 bytes
parma@sophie.ct.picker.com (Michael J. Parma) writes:

>'-Wall' causes the a warning about an unused variable.
>We don't want _any_ warning messages if we can help it....
>Something that works on any standard compiler would be welcomed

The easiest way to prevent the warning is to use the variable.  E.g.

	static char rcsid[] = "$Id: ... $";
	print_version() { printf("version: %s\n", rcsid); }

This works with any standard-conforming compiler.
Some compilers remove `rcsid' from the object file if it's not referenced;
you really must use rcsid if you want it to remain in the object file.
So GCC's warning is useful.
Technical Details
Message-ID: <bkFYsLbr@twinsun.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!usc!elroy.jpl.nasa.gov!news.claremont.edu!ucivax!ucla-cs!twinsun!eggert
References: <1993Jan15.201556.9105@picker.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,cb44527f7ddf772a
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1993-01-16 10:25:08 PST
Newsgroups: gnu.gcc.help
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!usc!elroy.jpl.nasa.gov!news.claremont.edu!ucivax!ucla-cs!twinsun!eggert
From: eggert@twinsun.com (Paul Eggert)
Subject: Re: SCCS strings embedded in code with -Wall
Message-ID: <bkFYsLbr@twinsun.com>
Sender: usenet@twinsun.com
Nntp-Posting-Host: bi
Organization: Twin Sun Inc, El Segundo, CA, USA
X-Newsreader: NN version 6.4.19
References: <1993Jan15.201556.9105@picker.com>
Distribution: na
Date: Sat, 16 Jan 1993 18:25:08 GMT
Lines: 15