Funny mistake
Rob Marchand
rob at array.UUCP
Thu Mar 21 00:33:01 AEST 1991
In article <15490 at smoke.brl.mil> gwyn at smoke.brl.mil (Doug Gwyn) writes:
>In article <1991Mar16.195153.15509 at murdoch.acc.Virginia.EDU> gsh7w at astsun.astro.Virginia.EDU (Greg Hennessy) writes:
>-#>>"if (a = b)" instead of "if (a == b)".
>-#>... I have yet to see a UNIX compiler complain about it
>-Doug Gwyn:
>-#That's good, because it is valid C and the compiler cannot know whether
>-#or not it reflects the programmer's intentions.
>-Then perhaps that is why having an optional flag to inform the user of
>-this sometimes suspicious code fragment may be a good idea.
>
>In the world of UNIX, we normally rely on "lint" to generate warnings
>about *possible* problems like this. The compilers are expected to
>accept conforming translation units and silently translate them.
There are several PD tools laying about that will catch this sort
of thing, and print a warning. As I understand it, they are
documented in one of the Nutshell Handbooks (hmm, Using Lint,
or some such, by Ian Darwin?), which (I believe) include listings
of the source code. The source is also available in the
nutshell/lint subdirectory on uunet for anon. ftp. I also have
the stuff if anyone wants a copy. No guarantees as to how well
they work, etc. Your mileage may vary.
Cheers!
Rob Marchand
--
Rob Marchand UUCP : uunet!attcan!lsuc!array!rob
Array Systems Computing ARPA : rob%array.UUCP at uunet.UU.NET
401 Magnetic Drive, Unit 24 Phone : +1(416)736-0900 Fax: (416)736-4715
Downsview, Ont CANADA M3J 3H9 Telex : 063666 (CNCP EOS TOR) .TO 21:ARY001
More information about the Comp.lang.c
mailing list