Token pasting in #include directive [repost]

Norman Diamond diamond at csl.sony.co.jp
Tue Nov 21 17:45:03 AEST 1989


This question is also a repost.  It seems to have gotten lost between
kddlabs and the rest of the world, and never got a reply.

According to section 3.8.2, page 89 lines 14 to 17, if pp-tokens are
macro replaced in an #include directive, the implementation might choose
to combine preprocessor tokens between a pair of " characters by, for
example, putting a space between each pair of preprocessor tokens.
(An implementation might do this because it always puts spaces between
preprocessor tokens, because two adjacent preprocessor tokens of - -
are not supposed to become a single real token --.)

Therefore in the example on page 93, line 17 might not yield the result
shown on line 23.  Line 23 is certainly a possibility, but another
possibility, depending on the implementation, is:
  #include "vers2 .h"
with an imbedded space.

I must ask again which carries more weight, the stated rules or the
examples.

-- 
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