Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!clyde.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!bu.edu!rpi!julius.cs.uiuc.edu!ux1.cso.uiuc.edu!aries!mcdonald From: mcdonald@aries.scs.uiuc.edu (Doug McDonald) Newsgroups: comp.lang.c Subject: Re: Do you trust the "indent" program? Message-ID: <1991Jan1.151157.19442@ux1.cso.uiuc.edu> Date: 1 Jan 91 15:11:57 GMT References: <12184@sybase.sybase.com> <5970@stpstn.UUCP> Sender: news@ux1.cso.uiuc.edu (News) Organization: School of Chemical Sciences, Univ. of Illinois at Urbana-Champaign Lines: 39 *************************************************************************** I would have used e-mail, but I know that it is hopeless: the poster of the following gave no "real" address, only the bogus one "lerman@stpstn.UUCP" He should edit his sendmail program to use a real address, either UUCP- style complete with !'s or internet style a@b.c.d.e. Or put his real address in a signature line. *************************************************************************** In article <5970@stpstn.UUCP> lerman@stpstn.UUCP (Ken Lerman) writes: > >NO, I would not trust indent. Then you are deluded. Indent is probably more trustworthy than your C compiler. > >Alternative 1: >You could write a program (call it undent) which replaces each >contiguous string of white space with a single blank character. You >could run it on my code before and after running indent and diff the >results. If they are the same, you are probably OK. This is a sufficient but not necessary condition. Indent will not in general pass this test. > >The one area of concern I'd have left is what is done with comments. >In particular, some CPPs treat the zero length comment /**/ as a >concatenation operator. Not if they are compiling the C language they don't. The string /**/ MUST be replaced by a single white space. Period. All pertinent references (K&R first edition, K&R second edition, and the actual ANSI standard) all agree 100% on this. If you so-called C compiler does something else, it is terminally broken. >Make sure that the undent program does NOT >treat this as white space. It MUST treat it as white space!!! Because that is what it is. Doug McDonald (mcdonald@aries.scs.uiuc.edu)