On Wed, 23 Mar 2016 12:59 am Adam Devita <adevita at verifeye.com> wrote:
> > This discussion on the nature of undefined behaviour code is > interesting. I don't know the reasoning, but it seems that VS6 often > initialized things to 0xcd in debug mode and (usually) had memory > uninitialized to 0x00 when complied in Release (perhaps 0x00 just > happens to be what was on the stack or heap). I presume this wasn't > just to make people suffer when things don't work the same in debug > vs release mode. > It's not uncommon for compilers to initialise variables to definitely bad values in debug mode to help find these kinds of bugs. However if you were getting 00s in VC++ you were getting lucky and would probably continue to get lucky until an unexpected stack allocation changed the usual location, after which all bets are off (speaking from VC++ experience and VC++6 specifically). >