Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!brutus.cs.uiuc.edu!wuarchive!texbell!nuchat!moray!siswat!buck From: buck@siswat.UUCP (A. Lester Buck) Newsgroups: comp.lang.c Subject: Re: Nested Comments in C -- A recent experience Message-ID: <517@siswat.UUCP> Date: 14 Mar 90 05:28:24 GMT References: <1523@wacsvax.OZ> <4320@daffy.cs.wisc.edu> <3690@tukki.jyu.fi> Organization: Photon Graphics, Houston Lines: 26 In article <1990Mar11.065712.9798@usenet.ins.cwru.edu> crds@pyrite.som.cwru.edu (Glenn A. Emelko) writes: >If the C compiler understood nested comments it would FORCE >programmers to match them, preventing wasted hours of debugging on >annoying problems like the above at the expense of a few milliseconds >of additional compile time. Try the lint helper programs at uunet!~/nutshell/lint/* as described in the Nutshell handbook on lint. These programs include: cchk - cchk check C programs for correctly matching brackets of all kinds (including quotes and comment brackets), checks that the indentation of matching brackets also matches, and checks for symptoms of three kinds of errors that the C compiler allows without warning: 'dangling else' errors where an else is bound to the wrong preceding if, nested comments (where the first close-comment bracket prematurely ends the outer comment), and the use of assigment ('=') where equality-test ('==') was meant. It is faster than the compiler and produces better messages; in particular, it localizes bracketing problems much more accurately. cchk was written by Steve Draper at Berkeley. -- A. Lester Buck buck@siswat.lonestar.org ...!texbell!moray!siswat!buck