1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-29 11:10:32 +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

5
NEWS
View file

@ -47,6 +47,11 @@ every line in a file.
* Changes to the distribution
* Build system changes
** -Werror=array-bounds is now added to CFLAGS when available
This catches <https://bugs.gnu.org/76907>
* Bug fixes
** `basename` now checks the suffix against the base name, not the full path

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"