To fix
../llvm/lib/Support/Windows/Path.inc(1265,21): warning: missing field
'InternalHigh' initializer [-Wmissing-field-initializers]
OVERLAPPED OV = {0};
Differential D85480
[NFC] Use value initializer for OVERLAPPED aeubanks on Aug 6 2020, 3:36 PM. Authored by
Details
To fix OVERLAPPED OV = {0};
Diff Detail
Event TimelineComment Actions Huh, I thought aggregate initialization was effectively zero-initialization for the remaining fields, so I'm surprised this changes anything. I would have expected the original line, which is idiomatic in Win32 code, to have zero-initialized all of the fields. But it looks like the field in question is part of a union, so maybe the rules there are different. I'll read up on it, but I don't see any harm here. Comment Actions OK, I see. I was looking at the wrong field. I'm not sure I see the value in this warning. I'd argue the replacement code is less clear. It's contrary to the entrenched idiom for Win32 programming. The old code in valid and correct in both C and C++, but the new code is not allowed in C. "In C, the braced list of initializers cannot be empty (note that C++ allows empty lists ...)." https://en.cppreference.com/w/c/language/struct_initialization |