3 ms·
Thanks to you, and everybody else, for the examples. I find it interesting upgrading the SDK could make your code invalid, due to uninitialized struct members.
by orra 5y ago
Thanks to you, and everybody else, for the examples.
I find it interesting upgrading the SDK could make your code invalid, due to uninitialized struct members. Compiler warnings can catch that sort of thing, thankfully—at least these days.
- MaulingMonkey 5y agoThere's a reason examples tend to use ZeroMemory or other mechanism for zero-initializing the entire struct ;) There are other subtle edge cases as well - like needing to make sure all code (including third party libs) is built with the same defines and settings if they might share said structs without painstaking checking cbSize & never passing by value. (Even that might not be enough when statically linking, as it's an ODR violation - and thus undefined behavior - to mix and match different definitions of the same struct...)