Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!pasteur!ernie.Berkeley.EDU!hunt From: hunt@ernie.Berkeley.EDU (Jim Hunt) Newsgroups: comp.lang.c Subject: Re: Concatenating with a compile-time definition in "ANSI" CPP Message-ID: <17975@pasteur.Berkeley.EDU> Date: 4 Oct 89 05:00:04 GMT References: <470004@gore.com> <29351@watmath.waterloo.edu> <17936@pasteur.Berkeley.EDU> <11212@smoke.BRL.MIL> Sender: news@pasteur.Berkeley.EDU Reply-To: hunt@ernie.Berkeley.EDU.UUCP (Jim Hunt) Organization: University of California, Berkeley Lines: 31 In article <11212@smoke.BRL.MIL> gwyn writes: >In <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 >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. Exactly, and it still works. I think this is what the ## was INVENTED for. To make the standard conform to the existing bugs/flaws/features in most systems. I mentioned that so those who do NOT have ansi compilers, can have a method to do all the things that ANSI is supposed to bring down from the Gods. I have tried it on all machines I have access to, and I still haven't found one where it fails. I would rather do ##, but until all non-ansi compilers are erased from the disks of the world, this is an option to remember. Question, what do ansi compilers do with that? They don't HAVE to have a pre-processor, but who doesn't, and if there is a PP, which eliminates /*comments*/, what token does it put in to identify where comments were? Would you complicate your yacc by allowing comment tokens everywhere? NO! I guess the solution would be in the lex phase, but I still think you are fighting hard to eliminate a rather harmless artifact of the fact that you use a preprocessor. jim hunt@ernie.Berkeley.EDU H&H Enterprises (1 employee) These ARE the bosses opinions, I AM the * boss!!! grad UCB, MS EE/CS, May 90, resume on request.