Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!ames!uhccux!munnari.oz.au!cs.mu.oz.au!ok From: ok@cs.mu.oz.au (Richard O'Keefe) Newsgroups: comp.lang.c Subject: Re: quotes inside #if 0 Keywords: ANSI, comments Message-ID: <2023@munnari.oz.au> Date: 5 Sep 89 03:50:16 GMT References: <2014@munnari.oz.au> <14512@haddock.ima.isc.com> Sender: news@cs.mu.oz.au Lines: 24 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... In article <14512@haddock.ima.isc.com>, karl@haddock.ima.isc.com (Karl Heuer) writes: > No, what you really mean is that you used to use a compiler that happened not > to complain about that, and now you use one that does. The introduction of > ANSI C between the two events is largely coincidental. It never was 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. I've even seen the device recommended in this newsgroup (I'd name names, but I've forgotten them). There are good reasons why a conditional inclusion facility should not treat omitted text as tokens (e.g. some new ANSI tokens were not legal before, like 2U, and some old ones, like 09, aren't legal now, and some compilers support extended syntax). For all programming languages X, good comments are good X.