diff --git a/ChangeLog b/ChangeLog index 89796e8..f6132dd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2024-08-26 Roy Hills + + * configure.ac: Unconditionally add -Wextra to GCC and Clang compiler + options instead of using the GCC_WEXTRA macro. -Wextra was added in + GCC 3.4.0, which is 20 years old now, and has always been supported + by Clang. There are no supported systems with earlier GCC versions. + + * m4/gcc-wextra.m4: Removed. + 2024-08-14 Roy Hills * get-iab: removed. This script is no longer needed and was depreciated diff --git a/configure.ac b/configure.ac index f96facd..06f818c 100644 --- a/configure.ac +++ b/configure.ac @@ -29,17 +29,19 @@ AC_ARG_ENABLE(gcov, AC_MSG_RESULT(no) ] ) -# Checks for programs. +# Check for utility programs that we need. AC_PROG_SED AC_PROG_CC +# Ensure the C compiler supports the C99 standard. if test "x$ac_cv_prog_cc_c99" = "xno"; then AC_MSG_ERROR([C compiler does not support C99 standard]) fi +# Add additional options if the C compiler identifies as GCC. +# This applies to Clang/LLVM in addition to GCC. if test -n "$GCC"; then AC_DEFINE([ATTRIBUTE_UNUSED], [__attribute__ ((__unused__))], [Define to the compiler's unused pragma]) - CFLAGS="$CFLAGS -Wall -Wshadow -Wwrite-strings" - GCC_WEXTRA + CFLAGS="$CFLAGS -Wall -Wextra -Wshadow -Wwrite-strings" GCC_STACK_PROTECT_CC GCC_FORTIFY_SOURCE GCC_FORMAT_SECURITY diff --git a/m4/gcc-wextra.m4 b/m4/gcc-wextra.m4 deleted file mode 100644 index 8bfaf01..0000000 --- a/m4/gcc-wextra.m4 +++ /dev/null @@ -1,18 +0,0 @@ -dnl Check for support of the GCC -Wextra option, which enables extra warnings. -dnl Support for this option was added in gcc 3.4.0. -dnl -AC_DEFUN([GCC_WEXTRA],[ - gcc_wextra=yes - if test "X$CC" != "X"; then - AC_MSG_CHECKING([whether ${CC} accepts -Wextra]) - gcc_old_cflags="$CFLAGS" - CFLAGS="$CFLAGS -Wextra" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[ - AC_MSG_RESULT(yes) - ],[ - AC_MSG_RESULT(no) - gcc_wextra=no - CFLAGS="$ssp_old_cflags" - ]) - fi -])