1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

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 <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Jun 16 14:43:17 UTC 2021 on sn-devel-184
This commit is contained in:
Andrew Bartlett 2021-06-16 16:51:14 +12:00 committed by Stefan Metzmacher
parent 263c95aee3
commit c9350fef6e
2 changed files with 5 additions and 1 deletions

View File

@ -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

View File

@ -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)")