loading...

re: The uninitialized variable anathema: non-deterministic C++ VIEW POST

FULL DISCUSSION
 

Unfortunately there is also some compilers that initialize these values in DEBUG mode to zero or whatever the default value is and in RELEASE mode they are then filled with random values. The reason might also be re–use of registers and stack values.

 

It may not be intentional that they are zero-initialized in DEBUG mode. They just happen to use freshed memory, and memory reuse is less aggressive.

I compile often with optmizations on, and still get lots of zeros in uninitialized areas.

Code of Conduct Report abuse