Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: I NEED HELP WITH THE MSVC compiler

Author: Russell Reagan

Date: 17:51:10 08/31/03

Go up one level in this thread


On August 31, 2003 at 15:53:46, Jaime Benito de Valle Ruiz wrote:

>This is not the first time that happens to me, and although every time I find
>the way to solve it, it's getting really annoying!
>
>I compile my program with the configuration set to Debug, I run a simple
>"Perft", and I get the right figure, and not even compiler warnings.
>
>I compile with Release settings, and both sides start to play illegal moves.
>
>Any idea of what could it be the problem?
>
>Thanks in advance.
>
>Jaime


Make sure that you are initializing your variables. When you compile in debug
mode, variables are automatically set to zero for you. When you compile in
release mode, variables are not initialized, and are set to whatever was already
in that particular memory location (which means it is undefined, garbage data).

Slater mentioned the optimization problem. You can try compiling in release mode
and turn optimizations off and see if you still have the problem. Don't confuse
"release mode" with "optimizations on". You can turn optimizations off in
release mode. If the problem goes away when you turn optimizations off, that
probably means it is the optimizer that is doing something you don't want.
Otherwise, I'd guess it's an uninitialized variable.



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.