←back to thread

1371 points yett | 1 comments | | HN request time: 0.492s | source
1. smallstepforman ◴[] No.43780740[source]
The core problem is some compilers initialising memory to zero in Debug mode, masking behaviour of unitialised data, since in most cases zero is a legit value. In Release mode, this zeroing doesn’t happen.

Devs need to be aware that the following C++ initisliser exists which zeros data structures for you:

MyStruct s = { };