A question about the pp-tokens in macro actual arguments.

Norman Diamond diamond at jit345.swstokyo.dec.com
Wed Mar 13 10:43:00 AEST 1991


In article <4370 at lupine.NCD.COM> rfg at lupine.ncd.com (Ron Guilmette) writes:

>This one should be easy.

These two are easy.

>When a formal argument for a function-like macro is replaced (whilst a
>macro call is being expanded) must (or may) the sequence of replacement
>pp-tokens include leading and/or trailing whitespace if the corresponding
>actual argument also contained leading or trailing whitespace (respectively)?

Whitespace is not part of a token.  However, whitespace may separate tokens.
If the preprocessor puts some whitespace (back) in when replacing an
argument, it should not matter.

And now for something completely different:

>In other words, what should be the result of:
>	#define PREFIX(x) prefix##x
>	... PREFIX ( xxyyzz) ...

The tokens must be pasted.
... [possible whitespace] prefixxxyyzz [possible whitespace] ...

--
Norman Diamond       diamond at tkov50.enet.dec.com
If this were the company's opinion, I wouldn't be allowed to post it.



More information about the Comp.std.c mailing list