Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!cica!ctrsol!uakari.primate.wisc.edu!ginosko!usc!henry.jpl.nasa.gov!elroy.jpl.nasa.gov!peregrine!ccicpg!taurus!capone!ndjc From: ndjc@capone.UUCP (Nick Crossley) Newsgroups: comp.lang.c Subject: Re: Concatenating with a compile-time definition in "ANSI" CPP Summary: V.4 preprocessor allows old stuff in transition mode Message-ID: <264@capone.UUCP> Date: 4 Oct 89 21:51:30 GMT References: <470004@gore.com> <29351@watmath.waterloo.edu> <17936@pasteur.Berkeley.EDU> <11212@smoke.BRL.MIL> Reply-To: ndjc@ccicpg.UUCP (Nick Crossley) Organization: ICL NA, Irvine CA Lines: 27 In article <11212@smoke.BRL.MIL> gwyn@brl.arpa (Doug Gwyn) writes: >In article <17936@pasteur.Berkeley.EDU> hunt@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@ccicpg.UUCP