From: Karel Zak Date: Wed, 1 Jul 2020 13:23:10 +0000 (+0200) Subject: build-sys: add --enable-werror X-Git-Tag: v2.36-rc2~27 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=63c80c4cf725564196b603e3a7c39d439218570f;p=thirdparty%2Futil-linux.git build-sys: add --enable-werror Add new ./configure option to make all compiler warnings into errors. Addresses: https://github.com/karelzak/util-linux/issues/1083 Signed-off-by: Karel Zak --- diff --git a/configure.ac b/configure.ac index 80da3f4201..543f2cc0ca 100644 --- a/configure.ac +++ b/configure.ac @@ -122,7 +122,6 @@ AC_C_BIGENDIAN dnl Compiler warnings UL_WARN_ADD([-fno-common]) UL_WARN_ADD([-Wall]) -UL_WARN_ADD([-Werror=sequence-point]) UL_WARN_ADD([-Wextra]) UL_WARN_ADD([-Wextra-semi]) UL_WARN_ADD([-Wembedded-directive]) @@ -146,8 +145,20 @@ UL_WARN_ADD([-Wformat-security]) UL_WARN_ADD([-Wimplicit-function-declaration]) UL_WARN_ADD([-Wdiscarded-qualifiers]) UL_WARN_ADD([-Waddress-of-packed-member]) + +AC_ARG_ENABLE([werror], + AS_HELP_STRING([--enable-werror], [make all compiler warnings into errors]), + [], [enable_werror=no] +) +AS_IF([test "x$enable_werror" = xyes], [ + UL_WARN_ADD([-Werror]) +],[ + UL_WARN_ADD([-Werror=sequence-point]) +]) + AC_SUBST([WARN_CFLAGS]) + UL_WARN_ADD([-Wno-clobbered], [BSD_WARN_CFLAGS]) AC_SUBST([BSD_WARN_CFLAGS])