ANSI proposal for preprocessor strings

Ken Arnold%CGL arnold at ucsfcgl.UUCP
Wed Feb 27 09:29:16 AEST 1985


In article <8436 at brl-tgr.ARPA> gwyn at Brl-Vld.ARPA (VLD/VMB) writes:
>One new feature of general interest is
>the way strings are handled by the preprocessor; instead of quoting
>rules I'll just post the example from section C.8.2:
>
>	#define debug(s, t)	printf("x" # s "= %d, x" # t "= %s", \
>				x ## s, x ## t)
>	debug(1, 2)
>
>results in ...
>
>	printf("x1= %d, x2= %s", x1, x2)

Has no one on the committee yet gotten the point that changing the
way this is done will require rewrites of a large amount of existing,
working C code?  Since the C preprocessor on 4.x bsd, System V, DECUS
C, and many other systems have scanned strings in macros for
parameter substitution since parameter macros were invented, dropping
this feature B R E A K S   E X I S T I N G   C O D E.  Lots of it.
The standard committee should look at how C is used, and it is used
with this feature in many places.

Look, I'm sure we all think certain existing things in C are ugly.
But how many peices of code would you like to re-write which, say,
relied on the fact that 'case's fall through unless told otherse?
As far as I can tell, the C language proper has not been broken on
purpose this way.  Why is it okay to break the preprocessor?

		-- DON'T BREAK WORKING CODE --
-- 

		Ken Arnold
=================================================================
Of COURSE we can implement your algorithm.  We've got this Turing
machine emulator...



More information about the Comp.lang.c mailing list