From 9934934a070b138c9ff11dd821a755020c39eefa Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 6 Jul 2020 10:34:56 +0200 Subject: Update autowaf and be explicit about warning flags --- waflib | 2 +- wscript | 47 ++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 45 insertions(+), 4 deletions(-) diff --git a/waflib b/waflib index b6958e34..f773f9a6 160000 --- a/waflib +++ b/waflib @@ -1 +1 @@ -Subproject commit b6958e34a03488f5615c91c5e1e29c0085e324cb +Subproject commit f773f9a6a1ace4e3ddda5db05db4fa49bd0173ac diff --git a/wscript b/wscript index ff20477b..b5e9c10a 100644 --- a/wscript +++ b/wscript @@ -44,14 +44,55 @@ def configure(conf): conf.load('autowaf', cache=True) autowaf.set_c_lang(conf, 'c99') - if Options.options.strict and not conf.env.MSVC_COMPILER: - conf.env.append_unique('CFLAGS', '-Wno-cast-align') - + if Options.options.strict: # Check for programs used by lint target conf.find_program("flake8", var="FLAKE8", mandatory=False) conf.find_program("clang-tidy", var="CLANG_TIDY", mandatory=False) conf.find_program("iwyu_tool", var="IWYU_TOOL", mandatory=False) + if Options.options.ultra_strict: + autowaf.add_compiler_flags(conf.env, '*', { + 'clang': [ + '-Wno-cast-align', + '-Wno-cast-qual', + '-Wno-covered-switch-default', + '-Wno-double-promotion', + '-Wno-format-nonliteral', + '-Wno-implicit-fallthrough', + '-Wno-padded', + '-Wno-reserved-id-macro', + '-Wno-sign-conversion', + '-Wno-switch-enum', + ], + 'gcc': [ + '-Wno-cast-align', + '-Wno-cast-qual', + '-Wno-padded', + '-Wno-sign-conversion', + '-Wno-switch-enum', + ], + 'msvc': [ + '/wd4061', # enumerator in switch is not explicitly handled + '/wd4365', # signed/unsigned mismatch + '/wd4514', # unreferenced inline function has been removed + '/wd4820', # padding added after construct + '/wd4996', # POSIX name for this item is deprecated + ], + }) + + autowaf.add_compiler_flags(conf.env, 'c', { + 'clang': [ + '-Wno-bad-function-cast', + ], + 'gcc': [ + '-Wno-bad-function-cast', + ], + 'msvc': [ + '/wd4706', # assignment within conditional expression + '/wd5045', # will insert Spectre mitigation for memory load + ], + }) + conf.env.update({ 'BUILD_UTILS': not Options.options.no_utils, 'BUILD_SHARED': not Options.options.no_shared, -- cgit v1.2.1