Macro names imbedded in pp-numbers [repost]

Norman Diamond diamond at csl.sony.co.jp
Thu Nov 16 15:53:10 AEST 1989


Sorry for the repost, but the original posting has not drawn any
replies.  Perhaps it was buried in kddlabs again.

Both the standard and the rationale say that in the pp-number
  0x7e-getchar()
it is illegal for my preprocessor to expand the getchar() macro.
If there is a real getchar() function, it is guaranteed that the
real function must be invoked by this expression.  This appears
to match the committee's intention, is not optional, and is not
implementation-defined.  Why?

I will have to add code to my scanner, and slow it down, so that
it will not call the preprocessor if it finds a macro in the middle
of a pp-number.

We have recently had discussions of what-is-reasonable vs. what-is-
written.  Does anyone think we can appeal to reason in this case,
so that implementations might be allowed to expand macros that are
found as independent real-tokens even though they're not separate
preprocessor-tokens?

-- 
Norman Diamond, Sony Corp. (diamond%ws.sony.junet at uunet.uu.net seems to work)
  Should the preceding opinions be caught or     |  James Bond asked his
  killed, the sender will disavow all knowledge  |  ATT rep for a source
  of their activities or whereabouts.            |  licence to "kill".



More information about the Comp.std.c mailing list