quotes inside #if 0

Richard O'Keefe ok at cs.mu.oz.au
Mon Sep 4 19:58:00 AEST 1989


I've just tried to compile a medium-sized program using a compiler which
tries to be ANSI-compliant.  The program was full of large comments like

	#if 0
		<oodles of English text and C examples>
	#endif

The compiler sees words like "don't" in the English text and snarls that
these are unterminated character constants.  This used to be perfectly
good C, and whatever the reason for ANSI C breaking well-commented programs,
I personally think the cost is way too high.  Spilled milk, alas.

The editor I use has a "comment-out-region" command which inserts spaces
between asterisks and slashes so that I can fix this by deleting the #if 0
and #endif and using that command.  I'd rather not:  having
	/ * a nested comment * /
in a file is asking for some clown to come along later and "correct" it.

Is there a way of having mixed English text and C fragments (possibly
including C comment delimiters) in a C program which _will_ work in ANSI C?



More information about the Comp.lang.c mailing list