Article View: gnu.gcc.help
Article #49645Re: not generating unused messages
From: Jim Balter
Date: Tue, 18 Jan 1994 06:17
Date: Tue, 18 Jan 1994 06:17
27 lines
1416 bytes
1416 bytes
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 -- <J Q B>
Technical Details
Message-ID:
<jqbCJtAso.1L1@netcom.com>Path:
arc1-ca.pugleaf.net!gmd.de!xlink.net!howland.reston.ans.net!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!decwrl!csus.edu!netcom.com!jqbReferences:
<2gs6qk$nan@news.parc.xerox.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-18 06:22:57 PST Newsgroups: gnu.gcc.help,comp.std.c Path: arc1-ca.pugleaf.net!gmd.de!xlink.net!howland.reston.ans.net!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!decwrl!csus.edu!netcom.com!jqb From: jqb@netcom.com (Jim Balter) Subject: Re: not generating unused messages Message-ID: <jqbCJtAso.1L1@netcom.com> Organization: NETCOM On-line Communication Services (408 241-9760 guest) References: <2gs6qk$nan@news.parc.xerox.com> Date: Tue, 18 Jan 1994 06:17:12 GMT Lines: 27