Funny mistake

Greg Hennessy gsh7w at astsun8.astro.Virginia.EDU
Thu Mar 21 12:15:04 AEST 1991


>>"if (a = b)" instead of "if (a == b)". 
>>... I have yet to see a UNIX compiler complain about it

Me:
#>-Then perhaps that is why having an optional flag to inform the user of
#>-this sometimes suspicious code fragment may be a good idea.

Doug Gwyn:
#>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.

Well,
1) I said optional flag, so the person who wants silent complations of
their strictly conforming programs get it, and the person who wants
warning can have that also.

2) Experiance has shown that having lint seperate from the compiler
means that many people would not use it.

I would sugguest that compilers should do lint (after setting a flag)
as part of their function.

I know for a fact that many would disagree.


--
-Greg Hennessy, University of Virginia
 USPS Mail:     Astronomy Department, Charlottesville, VA 22903-2475 USA
 Internet:      gsh7w at virginia.edu  
 UUCP:		...!uunet!virginia!gsh7w



More information about the Comp.lang.c mailing list