Concatenating with a compile-time definition in "ANSI" CPP
Nick Crossley
ndjc at capone.UUCP
Thu Oct 5 07:51:30 AEST 1989
In article <11212 at smoke.BRL.MIL> gwyn at brl.arpa (Doug Gwyn) writes:
>In article <17936 at pasteur.Berkeley.EDU> hunt at ernie.Berkeley.EDU.UUCP (Jim Hunt) writes:
>>You can do this in non ANSI environments (at least Sun) with
>>#define MyInit(arg) arg/**/Init
>>which is an ugly hack on the preprocessor, that is also defined
>>in the ANSI C preprocessor!
>
>What are you talking about? That's two tokens, not one spliced one,
>in both Standard C and K&R C. It was the UNIX (Reiser) cpp that was
>responsible for this misimplementation becoming widespread.
He might be referring to the preprocessor that is part of the AT&T
Unix V.4 compilation system. In that, if the 'transition mode' flag
-Xt is given to cc, most if not all of the "Reiserisms", including
parameter substitution is strings and token pasting with comments,
are allowed, with a warning. Since -Xt is the default at the moment,
it appears to the user that an 'ANSI C compiler' supports this
behaviour. Of course, AT&T said at the V.4 developers conferences
that the default mode will not be -Xt in the next release, so you
should abviously start converting your code to the correct ANSI C
preprocessor forms, and certainly not write new code using the old
forms (at least, not without appropriate #ifs).
--
<<< standard disclaimers >>>
Nick Crossley, ICL NA, 9801 Muirlands, Irvine, CA 92718-2521, USA 714-458-7282
uunet!ccicpg!ndjc / ndjc at ccicpg.UUCP
More information about the Comp.lang.c
mailing list