Concatenating with a compile-time definition in "ANSI" CPP

Wm E Davidsen Jr davidsen at crdos1.crd.ge.COM
Thu Oct 19 04:04:34 AEST 1989


In article <17975 at pasteur.Berkeley.EDU>, hunt at ernie.Berkeley.EDU (Jim Hunt) writes:

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

  Comments are replace with one blank. I think consecutive whitespace is
stripped, too, but my standard isn't handy.

#define foo(a,b) a/**/b

doesn't work for concat in an ANSI compiler for just this reason, but
your suggestion that it works on pcc is correct (in most cases). A
conditional definition of the macro will probably help.
-- 
bill davidsen	(davidsen at crdos1.crd.GE.COM -or- uunet!crdgw1!crdos1!davidsen)
"The world is filled with fools. They blindly follow their so-called
'reason' in the face of the church and common sense. Any fool can see
that the world is flat!" - anon



More information about the Comp.lang.c mailing list