Strange cc warning

Guy Harris guy at auspex.UUCP
Sun Feb 5 05:38:49 AEST 1989


>You may not use quote character (") in character variable. The part I've
>marked should be '\"' and then you should not get any warnings. 

That may well be true, but if so the compiler in question should be
fixed - and probably will be fixed, if they intend to make an ANSI C
compiler out of it once the standard comes out.

The May 13, 1988 dpANS claims in 3.1.3.4 "Character constants" that

	   The double-quote " and question-mark ? are representable
	either by themselves or by the escape sequences \" and \?
	respectively....

so within *single* quotes a " by itself should be OK.  I tried it on the
SunOS 4.0 PCC-derived compiler and it had no problem whatsoever with '"'
as a character constant.  (You obviously need to escape " inside a
*string* constant.)



More information about the Comp.lang.c mailing list