diff --git a/config/always-compiler-options.m4 b/config/always-compiler-options.m4 index e187f6ff8..f903655fa 100644 --- a/config/always-compiler-options.m4 +++ b/config/always-compiler-options.m4 @@ -22,7 +22,7 @@ AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_CC_ASAN], [ AS_IF([ test "$enable_asan" = "yes" ], [ AC_MSG_CHECKING([whether $CC supports -fsanitize=address]) saved_cflags="$CFLAGS" - CFLAGS="$CFLAGS -fsanitize=address" + CFLAGS="$CFLAGS -Werror -fsanitize=address" AC_LINK_IFELSE([ AC_LANG_SOURCE([[ int main() { return 0; } ]]) ], [ @@ -52,7 +52,7 @@ AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_CC_FRAME_LARGER_THAN], [ AC_MSG_CHECKING([whether $CC supports -Wframe-larger-than=]) saved_flags="$CFLAGS" - CFLAGS="$CFLAGS -Wframe-larger-than=4096" + CFLAGS="$CFLAGS -Werror -Wframe-larger-than=4096" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])], [ FRAME_LARGER_THAN="-Wframe-larger-than=4096" @@ -73,7 +73,7 @@ AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_CC_NO_FORMAT_TRUNCATION], [ AC_MSG_CHECKING([whether $CC supports -Wno-format-truncation]) saved_flags="$CFLAGS" - CFLAGS="$CFLAGS -Wno-format-truncation" + CFLAGS="$CFLAGS -Werror -Wno-format-truncation" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])], [ NO_FORMAT_TRUNCATION=-Wno-format-truncation @@ -100,7 +100,7 @@ AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_CC_NO_BOOL_COMPARE], [ AC_MSG_CHECKING([whether $CC supports -Wno-bool-compare]) saved_flags="$CFLAGS" - CFLAGS="$CFLAGS -Wbool-compare" + CFLAGS="$CFLAGS -Werror -Wbool-compare" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])], [ NO_BOOL_COMPARE=-Wno-bool-compare @@ -126,7 +126,7 @@ AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_CC_NO_UNUSED_BUT_SET_VARIABLE], [ AC_MSG_CHECKING([whether $CC supports -Wno-unused-but-set-variable]) saved_flags="$CFLAGS" - CFLAGS="$CFLAGS -Wunused-but-set-variable" + CFLAGS="$CFLAGS -Werror -Wunused-but-set-variable" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])], [ NO_UNUSED_BUT_SET_VARIABLE=-Wno-unused-but-set-variable @@ -147,7 +147,7 @@ AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_CC_NO_OMIT_FRAME_POINTER], [ AC_MSG_CHECKING([whether $CC supports -fno-omit-frame-pointer]) saved_flags="$CFLAGS" - CFLAGS="$CFLAGS -fno-omit-frame-pointer" + CFLAGS="$CFLAGS -Werror -fno-omit-frame-pointer" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])], [ NO_OMIT_FRAME_POINTER=-fno-omit-frame-pointer