Ok I’ll take a look at these when I get a chance but I think it’s important to understand what you’re asking as you’ll get different replies on this depending on who you ask.
This isn’t a Windows thing, in general C++ compilers don’t zero-initialise memory, this would incur a non-zero cost and C++ has the philosophy of “don’t pay for what you don’t use”. There is no way around this. I can imagine many performance code bases that wouldn’t want to zero-initialise their objects because they don’t want to pay this cost. They will rely on well formed code, static analysers and run-time sanitisers to check if any uninitialised objects/members are used.
You may not always see this because some compilers zero out memory in debug modes or fill them with a specific bit pattern so they can be caught at run time (e.g.
Running a tool that has an option to check for uninitialised members is not the same as ill-formed code. It’s more a “best practice for the safest code” if that’s what you’re prioritising over performance.
For us, in almost all situations we’d take this best practices approach but that might not always be the case if we have data that not zeroing structs has a noticeable performance hit.
Next time I’m in VS2019 I’ll see what is reported there and if there are places we can tidy up these warnings.