Is this correct action for the c compiler/preprocessor ??

Ken Arnold%CGL arnold at ucsfcgl.UUCP
Sat Nov 2 08:47:42 AEST 1985


In article <2667 at brl-tgr.ARPA> dfuller.wbst at Xerox.ARPA (Dave) writes:
>It also fails to work correctly on the C compiler supplied with Un*x
>system V for the AT&T Un*x PC but it does work the opional LPI C
>compiler; But don't ask me why?
>
>< Dave >

It does not "fail to work correctly" -- that's how it works.  It
allows you to say something like

	# define	Pval(var)	printf("var = %d\n", var)

	...
	pvar(Count);
	pvar(Errors);
	...

and get something like

	Count = 112
	Errors = 0

Being able to insert literal text in strings is very useful.  Even the
standards committee agreed, although they refused to continue to use
this method, since some preprocessors do *not* scan strings.  But
scanning strings for replacements is a feature, albeit a somewhat
unpopular one, which is purposefully used by many programs.

		Ken Arnold

P.S.  This was discussed at some length when several of us argued about
whether the standards committee was right to reject this method.  I
thought not, but others thought they were, and I don't want to start it
up again.



More information about the Comp.lang.c mailing list