🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #88

Is "#define __ foo" legal?

#88
From: J. Eric Townsend
Date: Wed, 05 Aug 1992 15:15
26 lines
1295 bytes
I'm building a bunch of stuff on a new machine, and I ran into a
problem where a source file (expr.c in gas-1.something) does the
following:


#define __ foo

static const operatorT op_encoding [256] = { __, __, O_foo, O_bar, __
[and so on, to fill out 256 places] }

The C compiler provided with the machine took the "#define", but
failed to substitute the following "__" with the correct symbol.  (cc
-E verifies this.)

I checked K&R + ansi and they say "#define identifier ... ".  Does
that specificially mean that the first token after a define must be a
valid identifier?  (I'm going to assume that it does.)

-thanks

--
             J. Eric Townsend --  jet@nas.nasa.gov -- 415.604.4311
                              '91 CB750, DoD# 0378
   "It's not his fault that he can't behave, Society's made him go astray..
                                 - Oingo Boingo
Technical Details
Message-ID: <JET.92Aug5151555@win30.nas.nasa.gov>
Path: arc1-ca.pugleaf.net!sparky!uunet!usc!cs.utexas.edu!sun-barr!ames!data.nas.nasa.gov!data.nas.nasa.gov!jet

Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c
Path: arc1-ca.pugleaf.net!sparky!uunet!usc!cs.utexas.edu!sun-barr!ames!data.nas.nasa.gov!data.nas.nasa.gov!jet
From: jet@win30.nas.nasa.gov (J. Eric Townsend)
Subject: Is "#define __ foo" legal?
Sender: news@nas.nasa.gov (News Administrator)
Organization: Numerical Aerodynamic Simulation, NASA Ames
Date: 5 Aug 92 15:15:55
Message-ID: <JET.92Aug5151555@win30.nas.nasa.gov>
Lines: 26