From: Gary Lockyer Date: Mon, 25 Sep 2017 01:16:48 +0000 (+1300) Subject: heimdal_build: Do not allow warnings in the heimdal code! X-Git-Tag: talloc-2.3.2~907 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fb0412360c299900fe0991bf31a232eb40b480ed;p=thirdparty%2Fsamba.git heimdal_build: Do not allow warnings in the heimdal code! (const excepted) Signed-off-by: Gary Lockyer Reviewed-by: Douglas Bagnall Updated to 2020 requirements since changes in 13a2f70a4dd6dd68e0dbd0379d35409c5f100f06 Signed-off-by: Andrew Bartlett --- diff --git a/source4/heimdal_build/wscript_build b/source4/heimdal_build/wscript_build index d07b147610a..a3733000f6e 100644 --- a/source4/heimdal_build/wscript_build +++ b/source4/heimdal_build/wscript_build @@ -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, diff --git a/source4/heimdal_build/wscript_configure b/source4/heimdal_build/wscript_configure index 903fb5139db..3a3d245d2bb 100644 --- a/source4/heimdal_build/wscript_configure +++ b/source4/heimdal_build/wscript_configure @@ -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