From: jlm@ugcs.caltech.edu (J. L. Mandelson) Newsgroups: alt.humor.best-of-usenet Subject: [comp.lang.c] Re: Turning the compiler warnings on Date: 24 Nov 1997 12:31:44 +0100 Subject: Re: Turning the compiler warnings on From: user923005@aol.com (User923005) Newsgroups: comp.lang.c Tim posed a question: >How common is it for C programmers to turn on most or all of the compiler >warnings during the development phase? I have no idea, but I not only turn on all the warnings, I also run lint against the source which typically churns out 5 times the volume of error messages that compilers do on their maximum setting. >The reason I ask is that when I get code from other people I often get >pages of warnings when I compile it with the warnings on. Many of these >are pretty dangerous looking ones, such as not returning anything from >a non-void function or using uninitialized variables. Well it's a good thing you found them then, those ARE dangerous errors. If you see a warning message, ANY warning message, read it and understand it. If you are not ABSOLUTELY sure that the warning can be ignored, don't ignore it. They are called warnings for a reason. They WARN you when you are about to do something stupid. Turning warnings off is only for the terminally lazy who are at the same time incompetent in their block-headed stupor which passes for idocy but is not really even that bright. After a while you can recognize spurious warnings. But if you are sure they are spurious, you might put in some assert() statements [you are asserting that they are not going to happen, after all]. Then when the assertions fail, you can find out that you were wong about being right about the messages being wrong. Do not turn warnings down. Turn them up. Crank the knob up until it snaps off permanently in your hand. Then throw it away in a hole. Tear up the map to the location of the hole. I'm at home, so I say anything I please.