From: Andrew Bartlett Date: Wed, 16 Jun 2021 04:51:14 +0000 (+1200) Subject: heimdal_build: Improve error and warning handling on old and new compilers X-Git-Tag: tevent-0.11.0~337 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c9350fef6e1141858ae2c3f200f3aaca5a8a29b8;p=thirdparty%2Fsamba.git heimdal_build: Improve error and warning handling on old and new compilers The previous commit 1eadeaed0a6ca3a58eb9fd176a7ae5bcc28f64ef had a couple of errors, the unpicky flags were being set on all builds (not just old compiler builds) due to confusing variable names, and Ubuntu 16.04 would not build (for fuzzing) because it thought some variables were maybe-uninitialized. This keeps stricter warnings->errors on modern compilers while allowing the full build, even in the near future when a modern Heimdal is imported. Signed-off-by: Andrew Bartlett Reviewed-by: Stefan Metzmacher Autobuild-User(master): Stefan Metzmacher Autobuild-Date(master): Wed Jun 16 14:43:17 UTC 2021 on sn-devel-184 --- diff --git a/source4/heimdal_build/wscript_build b/source4/heimdal_build/wscript_build index 28a1fb5240d..0c59fb85f3f 100644 --- a/source4/heimdal_build/wscript_build +++ b/source4/heimdal_build/wscript_build @@ -266,8 +266,9 @@ def HEIMDAL_LIBRARY(libname, source, deps, vnum, version_script, includes='', cf def HEIMDAL_CFLAGS(use_hostcc=False, extra_cflags=[]): cflags_unpicky=[] - if not bld.env.enable_heimdal_warnings: + if bld.env.allow_heimdal_warnings: cflags_unpicky += bld.env.HEIMDAL_UNPICKY_WNO_STRICT_OVERFLOW_CFLAGS + cflags_unpicky += bld.env.HEIMDAL_UNPICKY_WNO_MAYBE_UNINITIALIZED_CFLAGS # old compilers on centos7 or ubuntu1604 need this allow_warnings = bld.env.allow_heimdal_warnings diff --git a/source4/heimdal_build/wscript_configure b/source4/heimdal_build/wscript_configure index 3978d38c1a3..c4a3b1de99f 100644 --- a/source4/heimdal_build/wscript_configure +++ b/source4/heimdal_build/wscript_configure @@ -91,6 +91,9 @@ else: conf.ADD_NAMED_CFLAGS('HEIMDAL_UNPICKY_WNO_STRICT_OVERFLOW_CFLAGS', '-Wno-strict-overflow', testflags=True) + conf.ADD_NAMED_CFLAGS('HEIMDAL_UNPICKY_WNO_MAYBE_UNINITIALIZED_CFLAGS', + '-Wno-error=maybe-uninitialized', + testflags=True) Logs.info("Allowing warnings in Heimdal code as this compiler does " "not support enough -Wno-error flags (bad)")