diff mbox

[edk2,1/2] StdLib/LibC/gdtoa: fix "missing braces around initializer"

Message ID 1406938797-25234-2-git-send-email-lersek@redhat.com
State Accepted
Commit 599aa11f870264f6d86f3e1451afb6de07be1758
Headers show

Commit Message

Laszlo Ersek Aug. 2, 2014, 12:19 a.m. UTC
The member "u.L" is an array, and the current initializer triggers

  StdLib/LibC/gdtoa/strtof.c: In function '_strtof':
  StdLib/LibC/gdtoa/strtof.c:53:9: error: missing braces around
                                   initializer [-Werror=missing-braces]
  StdLib/LibC/gdtoa/strtof.c:53:9: error: (near initialization for
                                   'u.L') [-Werror=missing-braces]
  cc1: all warnings being treated as errors

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---
 StdLib/LibC/gdtoa/strtof.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/StdLib/LibC/gdtoa/strtof.c b/StdLib/LibC/gdtoa/strtof.c
index 44a4cb3..3b4b52c 100644
--- a/StdLib/LibC/gdtoa/strtof.c
+++ b/StdLib/LibC/gdtoa/strtof.c
@@ -50,7 +50,7 @@  strtof(CONST char *s, char **sp)
   ULong bits[1];
   Long expt;
   int k;
-  union { ULong L[1]; float f; } u = { 0 };
+  union { ULong L[1]; float f; } u = { { 0 } };
 
   k = strtodg(s, sp, &fpi, &expt, bits);
   if (k == STRTOG_NoMemory) {