🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #49464

Re: not generating unused messages

#49464
From: Jim Balter
Date: Sun, 23 Jan 1994 22:30
26 lines
1780 bytes
In article <CK3MrI.LH4@deshaw.com>,
Christos Zoulas <christos@deshaw.com> wrote:
...
>>In article <2gs6qk$nan@news.parc.xerox.com>,
>>Marty Leisner 25733 <leisner@sdsp.mc.xerox.com> wrote:
...
>>>define ID_STRING(x)            static char rcsid[] = x; USE_VAR(rcsid);
...
>What is the problem with:
>
>#define USE_VAR(var) (void) var
>
>christos

static char rcsid[] = "<id string>"; (void) rcsid;

is not legal C, and misses the point of the exercise.  In order to avoid a
warning from the compiler, var must be referred to; the only way to do that
in the context Marty is using is to make it part of an initializer for some
variable, and the problem with that is that the new variable is also subject
to a warning unless likewise used in an initializer.  The solutions proposed
make both var and the new variable use##var part of the initializer of
use##var.  Before asking "Why not just do it this way?", it's worth trying
to understand what problem the proposed solutions seem to be trying to solve.
-- 
<J Q B>
Technical Details
Message-ID: <jqbCK3t6p.F8I@netcom.com>
Path: arc1-ca.pugleaf.net!gmd.de!newsserver.jvnc.net!howland.reston.ans.net!usc!elroy.jpl.nasa.gov!decwrl!netcomsv!netcom.com!jqb
References: <2gs6qk$nan@news.parc.xerox.com> <jqbCJtAso.1L1@netcom.com> <CK3MrI.LH4@deshaw.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,270e3dcf6d9d2e3f
X-Google-Attributes: gid11318c,public
X-Google-Thread: 1149ec,270e3dcf6d9d2e3f
X-Google-Attributes: gid1149ec,public
X-Google-ArrivalTime: 1994-01-23 14:46:38 PST
Newsgroups: gnu.gcc.help,comp.std.c
Path: arc1-ca.pugleaf.net!gmd.de!newsserver.jvnc.net!howland.reston.ans.net!usc!elroy.jpl.nasa.gov!decwrl!netcomsv!netcom.com!jqb
From: jqb@netcom.com (Jim Balter)
Subject: Re: not generating unused messages
Message-ID: <jqbCK3t6p.F8I@netcom.com>
Organization: NETCOM On-line Communication Services (408 241-9760 guest)
References: <2gs6qk$nan@news.parc.xerox.com> <jqbCJtAso.1L1@netcom.com> <CK3MrI.LH4@deshaw.com>
Date: Sun, 23 Jan 1994 22:30:24 GMT
Lines: 26