From: Christian Brauner Date: Tue, 5 Feb 2019 19:43:00 +0000 (+0100) Subject: compiler: -Winit-self hardening X-Git-Tag: lxc-3.2.0~166^2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f03f7b5ce566d9601b83eb52ca1221d167157192;p=thirdparty%2Flxc.git compiler: -Winit-self hardening Warn about uninitialized variables that are initialized with themselves. Note this option can only be used with the -Wuninitialized option. Signed-off-by: Christian Brauner --- diff --git a/configure.ac b/configure.ac index 2e2209239..a6ff6eefa 100644 --- a/configure.ac +++ b/configure.ac @@ -704,6 +704,7 @@ AX_CHECK_COMPILE_FLAG([-Werror=implicit-function-declaration], [CFLAGS="$CFLAGS AX_CHECK_COMPILE_FLAG([-Wlogical-op], [CFLAGS="$CFLAGS -Wlogical-op"],,[-Werror]) AX_CHECK_COMPILE_FLAG([-Wmissing-include-dirs], [CFLAGS="$CFLAGS -Wmissing-include-dirs"],,[-Werror]) AX_CHECK_COMPILE_FLAG([-Wold-style-definition], [CFLAGS="$CFLAGS -Wold-style-definition"],,[-Werror]) +AX_CHECK_COMPILE_FLAG([-Winit-self], [CFLAGS="$CFLAGS -Winit-self"],,[-Werror]) AX_CHECK_LINK_FLAG([-z relro], [LDLAGS="$LDLAGS -z relro"],,[]) AX_CHECK_LINK_FLAG([-z now], [LDLAGS="$LDLAGS -z now"],,[])