Date: Thu, 24 Jun 1999 15:55:38 +0200 From: Hans-Bernhard Broeker Message-Id: <199906241355.PAA13309@acp3bf.physik.rwth-aachen.de> To: arg AT whangomatic DOT freeserve DOT co DOT uk (Andrew R. Gillett) Cc: djgpp AT delorie DOT com Subject: Re: Forgive me, for I have sinned without including math.h Newsgroups: comp.os.msdos.djgpp Organization: RWTH Aachen, III. physikalisches Institut B X-Newsreader: TIN [version 1.2 PL2] Reply-To: djgpp AT delorie DOT com In article you wrote: > I just found a strange anomaly. I had two identical functions in > different programs using sin(). Each program gave significantly different > results. I eventually found that one of them wasn't including math.h. Had you asked gcc to help you while you were writing those programs, the whole problem wouldn't probably have occured, in the first place. It's not strictly an error, but highly unwise to compile any fresh code without the use of the gcc options '-O2 -Wall', or even '-O2 -Wall -W'. And of course, you should pay attention to the warnings gcc throws at you, in this mode of operation. Not all of the warnings will be signs of serious problems, but most of them will. And it rarely hurts to remove the remaining 'superfluous' ones by adding variable initialisations, casts, or making other small adjustments to the code. In the case of 'sin()' without #including , you'ld have got a warning: "calling function without a prototype in sight" (or similar). In a nutshell: the tools are there, right at your fingertips. You just have to use them. -- Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de) Even if all the snow were burnt, ashes would remain.