diff --git a/configure b/configure index 1aa9bc2bf..0a17a4f7e 100755 --- a/configure +++ b/configure @@ -32294,6 +32294,120 @@ else $as_nop : fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -Wvla" >&5 +printf %s "checking whether C compiler accepts -Wvla... " >&6; } +if test ${ax_cv_check_cflags___Wvla+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + ax_check_save_flags=$CFLAGS + CFLAGS="$CFLAGS -Wvla" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ax_cv_check_cflags___Wvla=yes +else $as_nop + ax_cv_check_cflags___Wvla=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CFLAGS=$ax_check_save_flags +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___Wvla" >&5 +printf "%s\n" "$ax_cv_check_cflags___Wvla" >&6; } +if test x"$ax_cv_check_cflags___Wvla" = xyes +then : + CFLAGS="$CFLAGS -Wvla" +else $as_nop + : +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -Walloca" >&5 +printf %s "checking whether C compiler accepts -Walloca... " >&6; } +if test ${ax_cv_check_cflags___Walloca+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + ax_check_save_flags=$CFLAGS + CFLAGS="$CFLAGS -Walloca" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ax_cv_check_cflags___Walloca=yes +else $as_nop + ax_cv_check_cflags___Walloca=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CFLAGS=$ax_check_save_flags +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___Walloca" >&5 +printf "%s\n" "$ax_cv_check_cflags___Walloca" >&6; } +if test x"$ax_cv_check_cflags___Walloca" = xyes +then : + CFLAGS="$CFLAGS -Walloca" +else $as_nop + : +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -Wtrampolines" >&5 +printf %s "checking whether C compiler accepts -Wtrampolines... " >&6; } +if test ${ax_cv_check_cflags___Wtrampolines+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + ax_check_save_flags=$CFLAGS + CFLAGS="$CFLAGS -Wtrampolines" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ax_cv_check_cflags___Wtrampolines=yes +else $as_nop + ax_cv_check_cflags___Wtrampolines=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CFLAGS=$ax_check_save_flags +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___Wtrampolines" >&5 +printf "%s\n" "$ax_cv_check_cflags___Wtrampolines" >&6; } +if test x"$ax_cv_check_cflags___Wtrampolines" = xyes +then : + CFLAGS="$CFLAGS -Wtrampolines" +else $as_nop + : +fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports the fallthrough attribute" >&5 printf %s "checking whether $CC supports the fallthrough attribute... " >&6; } if test ${sudo_cv_var_fallthrough_attribute+y} diff --git a/configure.ac b/configure.ac index 13e0c2f26..0a19e7367 100644 --- a/configure.ac +++ b/configure.ac @@ -5025,6 +5025,9 @@ if test -n "$GCC"; then dnl CFLAGS="${CFLAGS} -Wall -Wsign-compare -Wpointer-arith -Wno-unknown-pragmas -Wmissing-prototypes -Wwrite-strings" AX_CHECK_COMPILE_FLAG([-Wshadow], [CFLAGS="$CFLAGS -Wshadow"]) + AX_CHECK_COMPILE_FLAG([-Wvla], [CFLAGS="$CFLAGS -Wvla"]) + AX_CHECK_COMPILE_FLAG([-Walloca], [CFLAGS="$CFLAGS -Walloca"]) + AX_CHECK_COMPILE_FLAG([-Wtrampolines], [CFLAGS="$CFLAGS -Wtrampolines"]) dnl dnl The fallthrough attribute is supported by gcc 7.0 and clang 10. dnl This test relies on AC_LANG_WERROR.