ANSI proposal for preprocessor strings

VLD/VMB gwyn at Brl-Vld.ARPA
Fri Feb 22 11:56:14 AEST 1985


I got my copy of the Feb. 1985 "preliminary draft proposed ANS" for C
yesterday and quickly scanned it for interesting changes.  It is really
in pretty good shape now, and many of the points that have been debated
in INFO-C have been dealt with.  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)

Space around the # and ## tokens in the macro definition is optional.

Another interesting addition is trigraphs for characters not in the
ISO 646 Invariant Code Set.  Example: ??< for {.

The <stdarg.h> [like <varargs.h>] macros have been changed, for the better.

And there are many other improvements both to the language and to the
specification document.



More information about the Comp.lang.c mailing list