Assorted C Questions

Doug Gwyn gwyn at smoke.BRL.MIL
Thu Sep 7 14:03:26 AEST 1989


In article <283 at crdos1.crd.ge.COM> davidsen at crdos1.UUCP (bill davidsen) writes:
-In article <1989Sep6.160004.19253 at utzoo.uucp>, henry at utzoo.uucp (Henry Spencer) writes:
-|  >#define min(x,y)	(((x) < (y)) ? (x) : (y))
-|  >foobar(min,max)
-|  >Sometype min,max;
-|  >   Will this foul up the preprocessor...
-|  No; parameterized macro names are recognized as such *only* when followed
-|  immediately by "(".
-  My standard isn't handy, but all of the preprocessors I use allow
-whitespace between the name and the ( ...

True but not relevant here.  "followed immediately" should be read as
talking about tokens, i.e. whitespace is assumed to be merely separating
tokens.  The important thing is that the token after the use of min is
a , and the token after the use of max is a ) or ;.



More information about the Comp.lang.c mailing list