Re: Debug vs Release...Some questions...Please Help...

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



See below...
On 20 Dec 2005 14:15:03 -0800, "Solomon_Man" <solomon_man@xxxxxxxxx> wrote:

>Hi All,
>Thanks for all the previous help thus far on my little project!
>
>This may be a basic question but can someone describe the differences
>between a Debug build and Release build.
>
> 1) Which build does all variables get initialized?
****
Abstractly, in neither build. The difference is that in the debug build, local variables
and heap variables are initiized to nonsense values that usually cause well-defined access
faults or give really bogus numeric values. If you have explicit initialization clauses,
e.g.,
int x = 4;
on a local variable, then x will be initialized to 4 in either build.
***
> 2) Why does a release build execute fine but the debug version bring
>up assertions,exceptions, etc?
****
Because your program is buggy. The release build merely ignores the errors that are
already in your program, that's why we have all those ASSERTs coming up: they say "your
program is wrong here. Fix it". In the release build, the errors may not show up, but
they still exist. Perhaps they are innocuous. Perhaps not. But they are errors, so you
have to fix them.
****
>
>The reason I am asking this question is I have application (exe) that
>runs fine in Release mode but the Debug versions cause different
>exceptions and asssertions to occur and I am trying to figure out why
>they are occuring and if in certain circumstances if this is OK?
***
Because ;your program is wrong. The apparent successful execution in release mode is an
illusion.
***
>
>Please Help.
>
>Thanks,
>Chris
>SolomonMan
Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.



Relevant Pages

  • Re: Multithreading (NSThread) and Local Variables
    ... but I didn't find an answer to this basic question: ... Are local variables re-created automatically for each thread? ... "re-created" for every function invocation, ... CPUs is something that can change on a microsecond-to-microsecond basis. ...
    (comp.sys.mac.programmer.help)
  • Re: How to set a watch for Object.Procedure.LocalVar ?
    ... the Local Variables window. ... This displays the Debug Inspector for that local variable. ... The local variables are not showing up in the window. ... I guess it's useless after all ?!? ...
    (alt.comp.lang.borland-delphi)
  • Debug vs Release...Some questions...Please Help...
    ... This may be a basic question but can someone describe the differences ... Why does a release build execute fine but the debug version bring ... SolomonMan ... Prev by Date: ...
    (microsoft.public.vc.mfc)
  • Re: How to set a watch for Object.Procedure.LocalVar ?
    ... Use the call stack window. ... Click on the function to view local variables for. ... Trying to debug thousands of possible loss of data situations via runtime is ... I guess it's useless after all ?!? ...
    (alt.comp.lang.borland-delphi)
  • Re: the loop control
    ... Kaz Kylheku wrote: ... local variables. ... I don't like that "feature" of C. ... It's harder to debug, it's harder to maintain. ...
    (comp.lang.c)