trouble with macro`s

Geoffrey Rogers grogers at convex.com
Mon Mar 18 03:41:14 AEST 1991


In article <1991Mar16.213446.20392 at NCoast.ORG> catfood at NCoast.ORG (Mark W. Schumann) writes:
>You could try
>
>  #dfine name2(a,b) a/**/b
>
>This might work, but I am not sure whether K&R compilers strip
>comments before or after evaluating macros.  Try it.

Yes this works on some not all pre-ANSI cpp. Another to do the
same thing is:

   #define name2(a,b)	name2_(a)b
   #define name2_(a)	a

this also works. But I do not know if it works on all pre-ANSI cpp.


+------------------------------------+---------------------------------+
| Geoffrey C. Rogers   		     | "Whose brain did you get?"      |
| grogers at convex.com                 | "Abbie Normal!"                 |
| {sun,uunet,uiucdcs}!convex!grogers |                                 |
+------------------------------------+---------------------------------+



More information about the Comp.lang.c mailing list