🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #49461

Re: not generating unused messages

#49461
From: Christos Zoulas
Date: Sun, 23 Jan 1994 20:11
30 lines
1558 bytes
In article <jqbCJtAso.1L1@netcom.com> jqb@netcom.com (Jim Balter) writes:
>In article <2gs6qk$nan@news.parc.xerox.com>,
>Marty Leisner 25733 <leisner@sdsp.mc.xerox.com> wrote:
>>I'm using:
>>
>>#define USE_VAR(var) static void * use_##var = (&use_##var, (void *) &var)
>>
>>to get around the unused warnings generated (with -Wall)
>>
>>(I'm using
>>
>>define ID_STRING(x)            static char rcsid[] = x; USE_VAR(rcsid);
>>
>>to define RCS strings).
>>
>>This doesn't seem to work in gcc 1.x, but in 2.x...
>>
>>Is it ansi C?  I understand the comma operator can appear anywhere...
>
>Nyet.  3.4 say constant expressions can't contain comma operators (sigh).
>
>But this passes gcc -Wall -pedantic:
>
>#define USE_VAR(var) static void * use_##var = 0?(void*)&use_##var:&var

What is the problem with:

#define USE_VAR(var) (void) var

christos
Technical Details
Message-ID: <CK3MrI.LH4@deshaw.com>
Path: arc1-ca.pugleaf.net!gmd.de!Germany.EU.net!EU.net!uunet!deshaw.com!christos
References: <2gs6qk$nan@news.parc.xerox.com> <jqbCJtAso.1L1@netcom.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 12:28:22 PST
Newsgroups: gnu.gcc.help,comp.std.c
Path: arc1-ca.pugleaf.net!gmd.de!Germany.EU.net!EU.net!uunet!deshaw.com!christos
From: christos@deshaw.com (Christos Zoulas)
Subject: Re: not generating unused messages
Message-ID: <CK3MrI.LH4@deshaw.com>
Sender: usenet@deshaw.com
Nntp-Posting-Host: fs2
Organization: D. E. Shaw & Co.
References: <2gs6qk$nan@news.parc.xerox.com> <jqbCJtAso.1L1@netcom.com>
Date: Sun, 23 Jan 1994 20:11:41 GMT
Lines: 30