]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
heimdal_build: Improve error and warning handling on old and new compilers
authorAndrew Bartlett <abartlet@samba.org>
Wed, 16 Jun 2021 04:51:14 +0000 (16:51 +1200)
committerStefan Metzmacher <metze@samba.org>
Wed, 16 Jun 2021 14:43:17 +0000 (14:43 +0000)
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

source4/heimdal_build/wscript_build
source4/heimdal_build/wscript_configure

index 28a1fb5240df35fb830044f3bc8a8b13b231d866..0c59fb85f3f48f697d14f7b10f3f4bbd1509ca7e 100644 (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
index 3978d38c1a35a40784f0b049c2b6d7a4509d1480..c4a3b1de99f80343462c06be3e45a77ab970471a 100644 (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)")