Do you trust the "indent" program?

Alvin "the Chipmunk" Sylvain asylvain at felix.UUCP
Fri Jan 4 10:22:34 AEST 1991


In article <1991Jan1.151157.19442 at ux1.cso.uiuc.edu> mcdonald at aries.scs.uiuc.edu (Doug McDonald) writes:
[...]
> In article <5970 at stpstn.UUCP> lerman at stpstn.UUCP (Ken Lerman) writes:
> >
> >NO, I would not trust indent.  
> Then you are deluded. Indent is probably more trustworthy than your
> C compiler.

Well, it has less work to do ... other than that, who knows?

[...]
> >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.

It may be standard, but there *are* C compilers which do this.  And, of
course, programmers who have taken advantage of the "feature".

> >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.

I agree.  However, when one is stuck with the task of making a piece of
code work, s/he is usually not concerned with what the "correct" is
supposed to be, except for the results generated by the application.

Actually, anyone with code which makes extensive use of the "feature"
should probably rewrite it anyway, especially if upgrading to a system
or compiler where the "feature" (correctly) doesn't exist.  But that's
a decision to be made on a case-by-case basis, i.e., is it cheaper to
rewrite the code, or find a kludge around the problem?  (I know, nobody
likes "kludges", but this is the real world and elegance must sometimes
take a backseat to expediency.  Ah, but that's a whole 'nother thread!)
--
asylvain at felix.UUCP (Alvin "the Chipmunk" Sylvain)
========================= Opinions are Mine, Typos belong to /usr/ucb/vi
"We're sorry, but the reality you have dialed is no longer in service.
Please check the value of pi, or see your SysOp for assistance."
UUCP: hplabs!felix!asylvain ============================================



More information about the Comp.lang.c mailing list