Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/36946 )
Change subject: Fix a handful of compiler warnings ......................................................................
Patch Set 7: Code-Review-1
(1 comment)
Sorry, I feel like I have to make a stand here. This whole story (including earlier patches) is getting incredibly ridiculous. There are nice warning options in todays compilers, but if a warning option sucks and makes us write worse code, then we shouldn't use it. I've wasted so much time discussing such options, that I could have spend reviewing and fixing actual bugs instead. IMHO, some warning options just make things worse.
If we feel like we need to write /* zero initialized */ because we do that implicitly and rely on that, while the language actually offers a nice and clean way to do that explicitly, then we failed, desperately. If we want a nice Clang experience, please let's just disable that ridiculous warning.
https://review.coreboot.org/c/flashrom/+/36946/2/util/ich_descriptors_tool/i... File util/ich_descriptors_tool/ich_descriptors_tool.c:
https://review.coreboot.org/c/flashrom/+/36946/2/util/ich_descriptors_tool/i... PS2, Line 155: struct ich_descriptors desc = { 0 };
Ron suggested using static which works well.
Well, here is how much I remember of the story:
* empty braces {} are not allowed in C * { 0 } is valid C for any aggregate even if it starts with a sub-aggregate (the 0 will just fill the first field of the first sub recursively, all other fields will be filled like static objects) * GCC folks made {} and { 0 } exceptions to -Wmissing-field-initializers, otherwise nobody would use that option because people would get mad, writing all the 0s. * Clang folks had a patch to make { 0 } an exception too, maybe they rolled it back, idk.