From: infidel+@pitt.edu (todd j. derr)
Subject: Re: Lint Picker?
Date: 7 Oct 93 06:46:33 GMT [thread overview]
Message-ID: <3533@blue.cis.pitt.edu> (raw)
In-Reply-To: 28vrdi$7ik@usenet.pa.dec.com
In article <4615@sparky.mdavcr.mda.ca> das@mdavcr.mda.ca (Darcy Semeniuk) writes:
>The lint that comes with OSF/1 v1.3 isn't very good - ie it misses
>things like:
>
>if ( a = b)
>{
>[.....]
>}
hm, this actually surprised me, but I tried it using Ultrix lint and
HP-UX 9.01 lint, and neither one complained about (a=b). Note that as
the other poster said, the code _will_ get executed unless b=0.
However, gcc -Wall (which is what I usually use, -Wall -pedanic -ansi),
does catch it, saying "Warning: suggest parentheses around assignment
used as truth value", which is nice, and a good habit to get in to.
Borland C (I turn all warnings on there as well), complains "Possibly
incorrect assignment", which is more the heart of it.
hm, and to think I was feeling guilty for never using lint on my code.
But, gcc -Wall -pedantic -ansi is probably just as good, if not better.
Use it.
todd.
--
todd j. derr (infidel+@pitt.edu) \ +1 (412) 422-2534 (h) \ 624-7063 (w)
university of pittsburgh lrdc \ moderator, comp.os.ms-windows.announce
prev parent reply other threads:[~1993-10-07 6:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
1993-10-06 17:20 Lint Picker? Darcy Semeniuk
1993-10-07 1:29 ` Jeffrey Mogul
1993-10-07 6:46 ` todd j. derr [this message]
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox