[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Compiler Warnings, again

>> Lee Spector writes:

>>  You want to give someone some code that is still under development.
>>  You know that the warnings don't indicate real problems for the user
>>  in question, and you don't want the user to be faced with a screen full
>>  of warnings every time they load the code.

I think distributing code like this is a bad idea. Code that generates warnings
has no business being distributed to users.  Users have enough trouble tracking
legitimate bugs.

 Too often I see code distributed to users that is full of warnings that could
easily be cleaned up by the programmer or the person distributing the code.  I
think that code that generates warnings has no business being distributed. 

I use warnings that are generated by other peoples code to detect bugs that
they would have noticed had they paid attention to the warnings rather than
ignoring them.  

Since I very often have to finish other peoples code or fix it for them, I want
warnings to be generated by my modifications, so the first thing I do before
fixing or extending other peoples code is examine each generated warning and
either fix the cause or add declarations which should be there.

It is well worth the trouble to write warning free code, so that legitimate
warnings will flag errors at compile time rather than run time.  Once you start
ignoring warnings, you are giving up a great deal of power provided by the
compiler for detecting errors.