From 2ddf01b446ed7e37da5d820696b32ffed91e90dc Mon Sep 17 00:00:00 2001 From: Jon Shallow Date: Sat, 24 Jan 2026 11:24:51 +0000 Subject: [PATCH] configure.ac: Fix -Wlogical-op test for cifuzz Report on ./configure warnings in ./get_config.sh --- configure.ac | 10 +++++++--- get_config.sh | 3 ++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 8a5e37f7..26725ea6 100644 --- a/configure.ac +++ b/configure.ac @@ -241,9 +241,12 @@ WARNING_CFLAGS="\ " # check whether or not the compiler supports -Wlogical-op (clang does not...) -AX_CHECK_COMPILE_FLAG([-Wlogical-op], [WARNING_CFLAGS="$WARNING_CFLAGS -Wlogical-op"],,[-Werror]) +# Note oss-fuzz uses clang and adds in option -Wno-error=unknown-warning-option which overrides -Werror +if test "x$CC" != "xclang"; then + AX_CHECK_COMPILE_FLAG([-Wlogical-op], [WARNING_CFLAGS="$WARNING_CFLAGS -Wlogical-op"],,[-Werror]) +fi AX_CHECK_COMPILE_FLAG([-fdiagnostics-color], [CFLAGS="$CFLAGS -fdiagnostics-color"],,[-Werror]) -AX_CHECK_COMPILE_FLAG([-Wunused-result], [WARNING_CFLAGS="$WARNING_CFLAGS -Wunused-result"]) +AX_CHECK_COMPILE_FLAG([-Wunused-result], [WARNING_CFLAGS="$WARNING_CFLAGS -Wunused-result"],,[-Werror]) # clang 14+ generates dwarf-5, which is not currently supported by valgrind if test "x$CC" = "xclang"; then @@ -1409,7 +1412,8 @@ libcoap Configuration Summary: libcoap ABI version : "$LIBCOAP_ABI_VERSION" libcoap libtool SO version : "$LIBCOAP_SO_VERSION" libcoap DTLS lib extn : "$LIBCOAP_DTLS_LIB_EXTENSION_NAME" - host system : "$host"]); + host system : "$host" + compiler : "$CC"]); if test "x$enable_server_mode" = "xyes"; then AC_MSG_RESULT([ build with server support : "yes"]) else diff --git a/get_config.sh b/get_config.sh index 0d3e31c9..d42c0959 100755 --- a/get_config.sh +++ b/get_config.sh @@ -8,7 +8,8 @@ TAGS=0 if [ -f config.log ] ; then echo "Last ./configure build" echo "" - cat config.log | grep -E " libcoap| host s" | cut -d\ -f7- + cat config.log | grep -E "WARNING:" | cut -d\ -f2- + cat config.log | grep -E " libcoap| host s| compiler" | cut -d\ -f7- cat config.log | grep -E "result: " | cut -d\ -f3- | cut -d\ -f7- echo "" TAGS=1