I work as a staff software engineer at a med tec company. We are mainly programming in C++ but my background is also a functional one (Haskell, OCaml).
In the past I did research in program analysis.
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.
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.