From: Philippe Antoine Date: Tue, 20 May 2025 09:12:59 +0000 (+0200) Subject: configure: add -Wshorten-64-to-32 to the flags X-Git-Tag: suricata-8.0.0-rc1~87 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e0e91c9302b83b449f8731e5d313b5ef4b7a909e;p=thirdparty%2Fsuricata.git configure: add -Wshorten-64-to-32 to the flags when configure is run with --enable-warnings Ticket: 6186 Also add -Wimplicit-int-conversion to the flags Both are not compatible with unit tests --- diff --git a/configure.ac b/configure.ac index bda1c5ebdc..adccf0c5a4 100644 --- a/configure.ac +++ b/configure.ac @@ -2323,6 +2323,27 @@ fi AC_MSG_RESULT([yes]), [AC_MSG_RESULT([no]) CFLAGS="$OCFLAGS"]) + # Following warnings are not respected by unit tests + if test "$enable_unittests" != "yes"; then + # check if our compiler supports -Wimplicit-int-conversion + AC_MSG_CHECKING(for -Wimplicit-int-conversion support) + OCFLAGS=$CFLAGS + CFLAGS="$CFLAGS -Wimplicit-int-conversion" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], + [[]])], + AC_MSG_RESULT([yes]), + [AC_MSG_RESULT([no]) + CFLAGS="$OCFLAGS"]) + # check if our compiler supports -Wshorten-64-to-32 + AC_MSG_CHECKING(for -Wshorten-64-to-32 support) + OCFLAGS=$CFLAGS + CFLAGS="$CFLAGS -Wshorten-64-to-32" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], + [[]])], + AC_MSG_RESULT([yes]), + [AC_MSG_RESULT([no]) + CFLAGS="$OCFLAGS"]) + fi ]) AC_CHECK_LIB(fuzzpcap, FPC_IsFuzzPacketCapture, HAS_FUZZPCAP="yes")