Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!mcsun!unido!ecrcvax!diomidis From: diomidis@ecrcvax.UUCP (Diomidis Spinellis) Newsgroups: comp.lang.c Subject: Re: quotes inside #if 0 Summary: Pcc doesn't like unterminated comments inside #if 0 Keywords: ANSI, comments Message-ID: <766@ecrcvax.UUCP> Date: 6 Sep 89 07:41:27 GMT References: <2014@munnari.oz.au> <14512@haddock.ima.isc.com> <2023@munnari.oz.au> Reply-To: diomidis@ecrcvax.UUCP (Diomidis Spinellis) Organization: ECRC, Munich 81, West Germany Lines: 31 In article <2023@munnari.oz.au> ok@cs.mu.oz.au (Richard O'Keefe) writes: >In article <2014@munnari.oz.au> ok@cs.mu.oz.au (Richard O'Keefe) writes: >> #if 0 ... [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... [...] >It is not at all coincidental. There was never any suggestion in any book >that #if 0-ed code had to have balanced single quotes, and the only C >compiler I've ever come across (I've used about a dozen) that complains >about it is the only one I've used that tries to be ANSI-compliant. ecrcvax% cat t.c #if 0 #funny_text /* #endif ecrcvax% /bin/cc -c t.c t.c: 2: undefined control t.c: 5: unterminated comment Vanila pcc complains about unbalanced comments and undefined preprocessor controls inside #if 0 blocks. Commenting out arbitrary text with #if 0 is not a safe practice for most compilers (both ANSI and classic C). Diomidis -- Diomidis Spinellis European Computer-Industry Research Centre (ECRC) Arabellastrasse 17, D-8000 Muenchen 81, West Germany +49 (89) 92699199 USA: diomidis%ecrcvax.uucp@pyramid.pyramid.com ...!pyramid!ecrcvax!diomidis Europe: diomidis@ecrcvax.uucp ...!unido!ecrcvax!diomidis