Alex James has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/31973
Change subject: ich_descriptors_tool: Fix -Wmissing-braces warning ......................................................................
ich_descriptors_tool: Fix -Wmissing-braces warning
This fix is needed for Clang.
Change-Id: I3cbf6bb6bdc34b812c2321c6674051af991362b4 Signed-off-by: Alex James theracermaster@gmail.com --- M util/ich_descriptors_tool/ich_descriptors_tool.c 1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/73/31973/1
diff --git a/util/ich_descriptors_tool/ich_descriptors_tool.c b/util/ich_descriptors_tool/ich_descriptors_tool.c index aa857c8..c71ef79 100644 --- a/util/ich_descriptors_tool/ich_descriptors_tool.c +++ b/util/ich_descriptors_tool/ich_descriptors_tool.c @@ -150,7 +150,7 @@ const char *fn = NULL; const char *csn = NULL; enum ich_chipset cs = CHIPSET_ICH_UNKNOWN; - struct ich_descriptors desc = { 0 }; + struct ich_descriptors desc = {{0}};
while ((opt = getopt(argc, argv, "df:c:")) != -1) { switch (opt) {
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/31973 )
Change subject: ich_descriptors_tool: Fix -Wmissing-braces warning ......................................................................
Patch Set 1: Code-Review+1
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/31973 )
Change subject: ich_descriptors_tool: Fix -Wmissing-braces warning ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/#/c/31973/1/util/ich_descriptors_tool/ich_descri... File util/ich_descriptors_tool/ich_descriptors_tool.c:
https://review.coreboot.org/#/c/31973/1/util/ich_descriptors_tool/ich_descri... PS1, Line 153: struct ich_descriptors desc = {{0}}; Hmm, these braces were just removed. AIUI, in C, `{ 0 }` serves as an initializer for every structure, no matter how deep or complex. So I don't see why Clang complains. I'd consider to check for Clang bug reports and file one in case there isn't a preceding case.
Stefan T has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/31973 )
Change subject: ich_descriptors_tool: Fix -Wmissing-braces warning ......................................................................
Patch Set 1: Code-Review-1
This was a long-standing bug in clang that is fixed in clang 6 and newer: https://bugs.llvm.org/show_bug.cgi?id=21689
Using {0} is *the* standard way to tell the compiler to initialize all fields (recursively) to its neutral value. Back in the times I would have put a -2 on this.
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/31973 )
Change subject: ich_descriptors_tool: Fix -Wmissing-braces warning ......................................................................
Patch Set 1:
This was a long-standing bug in clang that is fixed in clang 6 and newer: https://bugs.llvm.org/show_bug.cgi?id=21689
Thanks for looking this up (the linked commit also addresses -Wmissing-braces).
Using {0} is *the* standard way to tell the compiler to initialize all fields (recursively) to its neutral value. Back in the times I would have put a -2 on this.
No worries, nobody thought about merging this.
Alex, I guess this change can be abandoned.
Alex James has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/31973 )
Change subject: ich_descriptors_tool: Fix -Wmissing-braces warning ......................................................................
Patch Set 1:
Patch Set 1: Code-Review-1
This was a long-standing bug in clang that is fixed in clang 6 and newer: https://bugs.llvm.org/show_bug.cgi?id=21689
Using {0} is *the* standard way to tell the compiler to initialize all fields (recursively) to its neutral value. Back in the times I would have put a -2 on this.
Thanks for the bug report. I can still reproduce this with Clang 8.0, so it appears that this is one of the remaining edge cases which hasn't been fixed: https://bugs.llvm.org/show_bug.cgi?id=39931
I'll abandon this change and look into fixing this upstream.
Alex James has abandoned this change. ( https://review.coreboot.org/c/flashrom/+/31973 )
Change subject: ich_descriptors_tool: Fix -Wmissing-braces warning ......................................................................
Abandoned
Caused by clang bug, should be fixed upstream