Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!zaphod.mps.ohio-state.edu!rpi!uwm.edu!linac!att!att!ima!dirtydog!karl From: karl@ima.isc.com (Karl Heuer) Newsgroups: comp.std.c Subject: Re: C needs reliable comments Message-ID: <1991Jan18.161256.6720@dirtydog.ima.isc.com> Date: 18 Jan 91 16:12:56 GMT References: <2893@cirrusl.UUCP> Sender: news@dirtydog.ima.isc.com (NEWS ADMIN) Organization: Interactive Systems Lines: 22 In article <2893@cirrusl.UUCP> dhesi%cirrusl@oliveb.ATC.olivetti.com (Rahul Dhesi) writes: >Did you realize that C is one of the few programming languages, perhaps the >only one, in which you can never be sure of correctly commenting stuff out? Nonsense. It seems to me that any language with delimited-pair comments has the same property. >(b) You can use #if 0 and #endif to comment out a block of code. Then >[it breaks] if you have an invalid token or unbalanced quotes between these I agree with Doug that this is a silly objection. But if we accept it... >[proposal for a #comment...#endc block that is basically #if 0...#endif] Objection (b) still applies. The following two lines char *s = "continued\ #endc /*"; /* the string ends with a slash-star */ are a valid C fragment, but if you comment them out, you get something which is indistinguishable from an attempt to comment out the incomplete fragment consisting only of the first line. Karl W. Z. Heuer (karl@ima.isc.com or uunet!ima!karl), The Walking Lint