"Charlie Gordon" <ne**@chqrlie.o rg> writes:
"Keith Thompson" <ks***@mib.or g> wrote in message
news:ln******** ****@nuthaus.mi b.org... "Charlie Gordon" <ne**@chqrlie.o rg> writes: > "Dan Pop" <Da*****@cern.c h> wrote in message
> news:cn******** **@sunnews.cern .ch...
>> In <cn**********@r eader1.imaginet .fr> "Charlie Gordon" <ne**@chqrlie.o rg>
> writes:
>> >> A conforming C89 compiler need not be configurable to complain
>> >> about that.
>
> Granted.
>
> A compiler that does not complain about calling a function
> without proper prototype is either outdated or misconfigured or
> outdated. Fix that first.
That's not always an option, and a good C programmer should be able to
work even with outdated tools. Your compiler doesn't require you to
include the right headers? Do it anyway.
The vast majority of posters with such problems (calling
unprototyped functions) use fine compilers with default options :
none. It is a shame to give newbie C programmers "full fledged"
environments that do not enforce a minimum of consistency checking,
especially when all the needed support is readily available from the
compiler. Turn those warnings on.
Surprise your compiler. Write better code than it asks you to.
Yes, but make it ask you to if it can. Know your tools and take
advandage of them !
(Please keep your lines down to 72 columns or so. I've reformatted
some of the quoted text here.)
My followup implied more disagreement than I intended. Certainly you
should use good tools (including compilers that issue good warnings)
whenever possible. No matter how careful you are, you'll make
mistakes, and a good compiler may catch *some* of them for you.
You wrote "Fix that first", meaning to use a better compiler. I agree
with the "Fix that", but not necessarily with the "first". You need
to be careful to write good code in the first place, *and* you should
use the best compiler available with the best set of options. The
first is always possible with some effort and knowledge; the second is
usually possible, but not always.
And of course no compiler can catch all your errors. Experienced
programmers know this; newbies need to learn it.
--
Keith Thompson (The_Other_Keit h)
ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.