Path: utzoo!utgpu!water!watmath!clyde!cbosgd!ucbvax!hoptoad!gnu From: gnu@hoptoad.uucp (John Gilmore) Newsgroups: comp.lang.c Subject: Re: nested comments Message-ID: <3929@hoptoad.uucp> Date: 25 Jan 88 15:40:51 GMT References: <13423@pyramid.pyramid.com> <7937@eddie.MIT.EDU> Organization: Nebula Consultants in San Francisco Lines: 30 jbs@eddie.MIT.EDU (Jeff Siegal) wrote: > #ifdef COMPILE_BROKEN_CODE > > ... broken code ... > > #endif Unfortunately, ANSI C makes this less likely to work. The old Unix preprocessor ignored ' and " inside #ifdef's, so you really could #ifdef out just about anything you wanted, other than unterminated /* comments. But you might argue that it errs on stuff like this: #ifdef FOO printf("\ #endif FOO\ \n"); since it terminates the #ifdef at the #endif. Indeed, ANSI C says that the #endif does NOT terminate the #ifdef. The problem is that old code assumed it could put ' and " in #ifdef 0's; in particular it gets used for commentary that includes "can't" or "didn't" or other uses of unmatched single quotes; and the C preprocessor is also used on assembler sources, which use ' singly rather than in pairs (at least in the Vax assembler). So you'd better be sure that at least the quotes line up in your "broken code" before you #if 0 or #ifdef NOTDEF it away... -- {pyramid,ptsfa,amdahl,sun,ihnp4}!hoptoad!gnu gnu@toad.com "Watch me change my world..." -- Liquid Theatre