Author: Christophe Theron
Date: 19:02:10 04/04/00
Go up one level in this thread
On April 04, 2000 at 16:42:39, Dave Gomboc wrote:
>On April 04, 2000 at 16:32:20, Christophe Theron wrote:
>
>>On April 04, 2000 at 14:36:10, Frank Phillips wrote:
>>
>>>On April 03, 2000 at 22:35:47, Robert Hyatt wrote:
>>>
>>>[Snip]
>>>>>It is indicative of an uninitialized variable. A procedure call such as the
>>>>ones above simply stomp on the stack before your code gets to use the value
>>>>that was not initialized.
>>>>
>>>>you might try gcc -Wall -O2 to let it build a dependency graph and look for
>>>>such problems. If it sees a path from the top of the procedure to the bottom,
>>>>where any variable is referenced before it is initialized (local variables
>>>>only) it will give you a warning...
>>>
>>>Bob/Christophe
>>>
>>>Just as you predicted, an uninitialised variable. Everything is now back to
>>>normal.
>>>
>>>Easy when you know how……… Thanks, this was driving me insane.
>>>
>>>The gcc Wall option is very useful and found the extra variable easy. I had
>>>looked and looked and looked and………………….
>>>
>>>Frank
>>
>>
>>I suggest to have -Wall all the time. Do not change the warning level to match
>>the needs of your sources. Change your sources so -Wall detects NO warning, and
>>it will save yourself from a lot of trouble.
>>
>>
>> Christophe
>
>Yes, I try compiling with maximum warnings on multiple compilers to catch as
>many potential problems as possible. I have used CC from SGI and CC from SUN at
>University, g++ at home and there, and MSVC and IBM VisualAge for C++ from home.
> Going through that process brings my attention to all sorts of things that I
>might well have missed otherwise.
>
>Dave
The same for me. Tiger's sources have been adapted so they can be compiled on at
least 3 different compilers (DJGPP under DOS, Borland C 4.5 under Windows as a
console application, and Visual C++ 6.0 SP3 both as console app or DLL).
With each new compiler, new potential problems have been found!
I think that adapting a program so it can be compiled with different compilers
under various platforms helps a lot to make the code much more robust.
Christophe
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.