Debug Works, Release Fails 
Author Message
 Debug Works, Release Fails

Hi --

    I've developed a program in which the debug mode works and the release
mode fails. This has happened to me in the past, and without exception, the
problem always turns out to be an uninitialized variable -- which in debug
mode seems to be set to zero/NULL, but in release mode is some undefined
random value...

    Rather than trying to track this uninitialized demon down by hand, is
there a way that I can get VC++ to scan my code and tell me if there is a
particular code path that might lead to a variable not being assigned a
value prior to use of the variable? I'll bet anything that this is my
problem.

Go in peace, my friend.

--
Fred Sanford

"To understand recursion, we must first understand recursion."



Mon, 13 Oct 2003 23:03:54 GMT  
 Debug Works, Release Fails
I do not know if it would help to change the warning level but there is a
compiler option to do that. Look in the project settings for setting the
warning level.


Quote:
> Hi --

>     I've developed a program in which the debug mode works and the release
> mode fails. This has happened to me in the past, and without exception,
the
> problem always turns out to be an uninitialized variable -- which in debug
> mode seems to be set to zero/NULL, but in release mode is some undefined
> random value...

>     Rather than trying to track this uninitialized demon down by hand, is
> there a way that I can get VC++ to scan my code and tell me if there is a
> particular code path that might lead to a variable not being assigned a
> value prior to use of the variable? I'll bet anything that this is my
> problem.

> Go in peace, my friend.

> --
> Fred Sanford

> "To understand recursion, we must first understand recursion."



Tue, 14 Oct 2003 00:26:49 GMT  
 Debug Works, Release Fails

Quote:
>    I've developed a program in which the debug mode works and the release
>mode fails. This has happened to me in the past, and without exception, the
>problem always turns out to be an uninitialized variable -- which in debug
>mode seems to be set to zero/NULL, but in release mode is some undefined
>random value...

Fred,

Uninitialised variables are random in debug builds as well as release
builds - they're just a different random to the release build :)

If you're using VC6 you should try a debug build with the /GZ switch -
which may help identify any uninitialised variables.

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
My address is altered to discourage junk mail.
Please post responses to the newsgroup thread,
there's no need for follow-up email copies.



Tue, 14 Oct 2003 00:44:56 GMT  
 Debug Works, Release Fails
Lint programs will find *some* uninitialized variables.

I use PC-Lint  see www.gimpel.com
(Be prepared to find *many* other errors - but they can be turned off
individually).

HTH
Steve

Quote:

> Hi --

>     I've developed a program in which the debug mode works and the release
> mode fails. This has happened to me in the past, and without exception, the
> problem always turns out to be an uninitialized variable -- which in debug
> mode seems to be set to zero/NULL, but in release mode is some undefined
> random value...

>     Rather than trying to track this uninitialized demon down by hand, is
> there a way that I can get VC++ to scan my code and tell me if there is a
> particular code path that might lead to a variable not being assigned a
> value prior to use of the variable? I'll bet anything that this is my
> problem.

> Go in peace, my friend.

> --
> Fred Sanford

> "To understand recursion, we must first understand recursion."



Wed, 15 Oct 2003 00:26:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Debug Works, Release Fails

2. DEBUG works, RELEASE fails

3. MIDL compiler fails during release mode but works fine in debug mode

4. Modeless Propertysheet works in debug but fails in release

5. debug version works, release version sometimes fails

6. Region creation, works in debug, fails in release...

7. Program not work at release mode but work at debug mode

8. Helps need on adding debug info to release mode so to debug release code

9. Fails in DEBUG but not Release?!

10. Debug version Ok, Release version Failed

11. Release fails - Debug OK

12. Debug version Ok, Release fails

 

 
Powered by phpBB® Forum Software