[Git][NTPsec/ntpsec][master] Revert "easier-to-use conditional warning flags"
Eric S. Raymond
gitlab at mg.gitlab.com
Tue Apr 11 19:42:18 UTC 2017
Eric S. Raymond pushed to branch master at NTPsec / ntpsec
Commits:
8b13059e by Eric S. Raymond at 2017-04-11T15:41:32-04:00
Revert "easier-to-use conditional warning flags"
It broke the configure logic.
- - - - -
1 changed file:
- wafhelpers/configure.py
Changes:
=====================================
wafhelpers/configure.py
=====================================
--- a/wafhelpers/configure.py
+++ b/wafhelpers/configure.py
@@ -308,7 +308,7 @@ def cmd_configure(ctx, config):
"-Wswitch-default",
"-Wwrite-strings",
]
- cc_test_and_add_flags = [
+ cc_test_flags += [
('w_format_signedness', '-Wformat-signedness'), # fails on OpenBSD 6
('w_sign_conversion', "-Wsign-conversion"), # fails on Solaris and OpenBSD 6
('w_suggest_attribute_noreturn', "-Wsuggest-attribute=noreturn"), # fails on clang
@@ -345,16 +345,6 @@ int main(int argc, char **argv) {
msg='Checking if C compiler supports ' + name,
run_build_cls='oc')
- for (name, ccflag) in cc_test_and_add_flags:
- ctx.check(cflags=ccflag,
- define_name='HAS_' + name,
- fragment=FRAGMENT,
- mandatory=False,
- msg='Checking if C compiler supports ' + ccflag,
- run_build_cls='oc')
- if ctx.env['HAS_' + name]:
- ctx.env.CFLAGS += [ccflag]
-
ctx.run_build_cls = old_run_build_cls
# We require some things that C99 doesn't enable, like pthreads.
@@ -397,6 +387,16 @@ int main(int argc, char **argv) {
"-flto",
]
+ # debug warnings that are not available with all compilers
+ if ctx.env.HAS_w_format_signedness:
+ ctx.env.CFLAGS += [
+ '-Wformat-signedness',
+ ]
+ if ctx.env.HAS_w_sign_conversion:
+ ctx.env.CFLAGS += [
+ '-Wsign-conversion',
+ ]
+
# old gcc takes -z,relro, but then barfs if -fPIE available and used.
# ("relro", "-Wl,-z,relro"), # marks some sections read only
old_run_build_cls = ctx.run_build_cls
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/8b13059e4936e7424062f0b69737b3ecbd96317e
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170411/e18b5814/attachment.html>
More information about the vc
mailing list