1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-29 19:30:36 +02:00

configure: add -Werror=array-bounds to CFLAGS when available

This would have prevented https://bugs.gnu.org/76907

* configure.ac: add -Werror=array-bounds to CFLAGS when available
This commit is contained in:
Rob Browning 2025-03-18 12:56:31 -05:00
parent 4af6331a65
commit aeb89f6ad6
2 changed files with 13 additions and 0 deletions

View file

@ -62,6 +62,14 @@ AC_PROG_INSTALL
AC_PROG_CC
gl_EARLY
AC_MSG_CHECKING([whether the compiler supports -Werror=array-bounds])
old_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Werror=array-bounds"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([int foo;], [])],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
CFLAGS="$old_CFLAGS"])
AC_MSG_CHECKING([whether the compiler supports -fexcess-precision=standard])
old_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fexcess-precision=standard"