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

Henry Spencer henry at utzoo.UUCP
Tue Nov 5 10:55:52 AEST 1985


> I would think that anything inside double quotes is protected
> from any/all substitution, and that the preprocessor, would
> not do the parameter replacement.

This is an ill-documented quirk of the Unix C preprocessor.  It is not
portable because many other C compilers don't do it, and X3J11 has
decided to provide the capability but with a different syntax.  Until
that happy day when a randomly-chosen C compiler has a high probability
of conforming to the ANSI soon-to-be-standard, the only safe thing to do
is to avoid writing macros in which something that looks like one of the
parameter names appears inside a string.
-- 
				Henry Spencer @ U of Toronto Zoology
				{allegra,ihnp4,linus,decvax}!utzoo!henry



More information about the Comp.lang.c mailing list