[PATCH] Revert "wafsamba: Enable warnings for missing field initializer"

Christof Schmitt cs at samba.org
Mon Apr 29 19:36:39 UTC 2019


Revert the patch adding the warnings since that causes problems when
compiling master on RHEL7. Many C99 initializers of nested structs are
flagged as problematic, so it seems easier to remove the additional
compiler checks.

Christof
-------------- next part --------------
From ac1ea9cbf5f70db05498de618b8a0bd096e76c9f Mon Sep 17 00:00:00 2001
From: Christof Schmitt <cs at samba.org>
Date: Mon, 29 Apr 2019 12:16:31 -0700
Subject: [PATCH] Revert "wafsamba: Enable warnings for missing field
 initializer"
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This reverts commit cf79ee15bd2e669d881f92bfd1a1ab1034615480.

The additional warning triggers many false positives with
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36)
which then result in compiler errors with --pick-developer

One example:

../../libcli/auth/netlogon_creds_cli.c: In function ‘netlogon_creds_cli_ServerGetTrustInfo_done’:
../../libcli/auth/netlogon_creds_cli.c:3117:15: error: missing initializer for field ‘hash’ of ‘const struct samr_Password’ [-Werror=missing-field-initializers]
  const struct samr_Password zero = {};
               ^
In file included from ./librpc/gen_ndr/netlogon.h:12:0,
                 from ../../libcli/auth/libcli_auth.h:20,
                 from ../../source4/../libcli/auth/schannel.h:23,
                 from ../../libcli/auth/netlogon_creds_cli.c:31:
./librpc/gen_ndr/samr.h:541:10: note: ‘hash’ declared here
  uint8_t hash[16];

Signed-off-by: Christof Schmitt <cs at samba.org>
---
 buildtools/wafsamba/samba_autoconf.py | 1 -
 1 file changed, 1 deletion(-)

diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py
index f2b049e40a7..98ffdfea458 100644
--- a/buildtools/wafsamba/samba_autoconf.py
+++ b/buildtools/wafsamba/samba_autoconf.py
@@ -731,7 +731,6 @@ def SAMBA_CONFIG_H(conf, path=None):
         conf.ADD_CFLAGS('-Wall', testflags=True)
         conf.ADD_CFLAGS('-Wshadow', testflags=True)
         conf.ADD_CFLAGS('-Wmissing-prototypes', testflags=True)
-        conf.ADD_CFLAGS('-Wmissing-field-initializers', testflags=True)
         conf.ADD_CFLAGS('-Wcast-align -Wcast-qual', testflags=True)
         conf.ADD_CFLAGS('-fno-common', testflags=True)
 
-- 
2.17.0



More information about the samba-technical mailing list