]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
heimdal_build: Do not allow warnings in the heimdal code!
authorGary Lockyer <gary@catalyst.net.nz>
Mon, 25 Sep 2017 01:16:48 +0000 (14:16 +1300)
committerDouglas Bagnall <dbagnall@samba.org>
Fri, 7 Aug 2020 03:23:44 +0000 (03:23 +0000)
(const excepted)

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Updated to 2020 requirements since changes in
13a2f70a4dd6dd68e0dbd0379d35409c5f100f06

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
source4/heimdal_build/wscript_build
source4/heimdal_build/wscript_configure

index d07b147610a51ba4553b2ec3486c83534f7a0060..a3733000f6e6543a7f011fe56d91eb8904eb7395 100644 (file)
@@ -287,11 +287,20 @@ def HEIMDAL_SUBSYSTEM(modname, source,
 
     bld.set_group(group)
 
+    # If we found the -Wno-error options we need then build without
+    # allowing warnings, otherwise permit them
+    if bld.env.enable_heimdal_warnings:
+        samba_cflags = CURRENT_CFLAGS(bld, modname, cflags) + \
+                       bld.env.HEIMDAL_PICKY_CFLAGS
+    else:
+        samba_cflags = CURRENT_CFLAGS(bld, modname, cflags,
+                                      allow_warnings=True)
+
     return bld(
         features       = 'c',
         source         = source,
         target         = modname,
-        samba_cflags   = CURRENT_CFLAGS(bld, modname, cflags, allow_warnings=True),
+        samba_cflags   = samba_cflags,
         depends_on     = '',
         samba_deps     = to_list(deps),
         samba_includes = includes,
index 903fb5139db8b30845cb52645c3d6ca28c1aaa58..3a3d245d2bb98c19d32bc5ce2d3ecb52907c7064 100644 (file)
@@ -65,6 +65,24 @@ conf.CHECK_FUNCS('dirfd', headers='dirent.h')
 conf.CHECK_DECLS('dirfd', reverse=True, headers='dirent.h')
 conf.CHECK_STRUCTURE_MEMBER('DIR', 'dd_fd', define='HAVE_DIR_DD_FD',  headers='dirent.h')
 
+heimdal_no_error_flags = ['-Wno-error=discarded-qualifiers',
+                          '-Wno-error=cast-qual',
+                          '-Wno-error=missing-field-initializers',
+                          '-Wno-error=shadow',
+                          '-Wno-error=implicit-fallthrough',
+                          '-Wno-error=enum-compare',
+                          '-Wno-error=unused-but-set-variable',
+                          '-Wno-error=unused-const-variable',
+                          '-Wno-error=unused-variable',
+                          '-Wno-error=unused-result']
+for flag in heimdal_no_error_flags:
+    conf.ADD_NAMED_CFLAGS('HEIMDAL_PICKY_CFLAGS',
+                          flag,
+                          testflags=True)
+
+if len(bld.env.HEIMDAL_PICKY_CFLAGS) == len(heimdal_no_error_flags):
+    conf.env.enable_heimdal_warnings = True
+
 conf.DEFINE('SAMBA4_USES_HEIMDAL', 1)
 
 # setup the right defines for a in-tree heimdal build