From: "Curtis Cameron" <[EMAIL PROTECTED]>
> The suggestion to turn on all compiler warnings was the one that did the 
> trick to solve the original problem, though. ...
(snip)
> ... I think the compiler warning that really solved the problem was 
> when it found two times in MainFormHandleEvent() when I simply used 
> "return" instead of "return handled". I was surprised to learn that you 
> have to enable all warnings to see something that would be a serious 
> problem in any case. Wouldn't this error pretty much always lead to 
> crashes?
> 
I guess a warning is something that a programmer might possibly 
want to do deliberately, rather than a syntactic fault, although I 
agree that the omission of a return value seems like a surprising 
warning.

All compilers have this sort of issue, however - the example 
that always amazed me was that Visual Studio (prior to .NET) 
treated an assignment within an if statement as a level four warning  
and, by default, only reported up to level three (or the other 
way around).  Who-ever decided that an assignment within an 
if statement was more likely to be a deliberate decision than a
missing equals needed taking out back for a good kicking.

After discovering that compiler switch the hard way I got into the 
habit of always turning all warnings on.  Even though checking 
details like every numeric conversion warning is a real drag, your 
code will be more solid and reliable because of it.  Of course it's
tough to do with a manager leaning in the door every hour to ask
if you've finished yet. :-)

Chris Tutty


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please 
see http://www.palmos.com/dev/support/forums/

Reply via email to