Need help using /usr/lib/cpp for generic text

Richard O'Keefe ok at cs.mu.oz.au
Fri Sep 22 20:35:43 AEST 1989


In article <3323 at solo10.cs.vu.nl>, maart at cs.vu.nl (Maarten Litmaath) writes:
> One limitation: you shouldn't use `/*' and `*/' to comment out text; instead
> use:
> 	#if 0
> 	...
> 	#endif 0

This advice was correct in the specific context (using cpp for generic text
on a particular operating system).  However, it is not correct for C.
        #endif 0
(a)            ^ this token is not legal in dpANS C; V.3 tends not to like it
(b) You should not use this technique to comment out text in a C program; new
C compilers are allowed to complain about mismatched quotes when they see
"don't" and other such text, and some _do_.

    You're going to laugh, but how about using the Bourne shell as a
condition processing facility?  E.g.
	if [ ... ] ; then
	    cat <<'EndOfPart'
	any old text -- almost
	EndOfPart
	else
	    # equivalent of 'include'
	    cat foo.inc
	fi



More information about the Comp.unix.wizards mailing list