From 548d5d4c4619b90c6242fa30b87ec78da43ef445 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sat, 7 Mar 2026 13:38:04 +0100 Subject: [PATCH] build enable -Wformat-signedness again --- CMake/PickyWarnings.cmake | 8 ++++++-- m4/curl-compilers.m4 | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CMake/PickyWarnings.cmake b/CMake/PickyWarnings.cmake index aca79ec947..c811d2ef47 100644 --- a/CMake/PickyWarnings.cmake +++ b/CMake/PickyWarnings.cmake @@ -250,7 +250,9 @@ if(PICKY_COMPILER) if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 19.1) OR (CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 17.0)) list(APPEND _picky_enable - -Wno-format-signedness # clang 19.1 gcc 5.1 appleclang 17.0 # In clang-cl enums are signed ints by default + -Wformat-signedness # clang 19.1 gcc 5.1 appleclang 17.0 # In clang-cl enums are signed ints by default + -Wno-error=format-signedness + -Wno-error=format ) endif() if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 21.1) OR @@ -306,7 +308,9 @@ if(PICKY_COMPILER) if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 5.0) list(APPEND _picky_enable -Warray-bounds=2 # clang 2.9 gcc 5.0 (clang default: -Warray-bounds) - -Wno-format-signedness # clang 19.1 gcc 5.1 appleclang 17.0 + -Wformat-signedness # clang 19.1 gcc 5.1 appleclang 17.0 + -Wno-error=format-signedness + -Wno-error=format ) endif() if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 6.0) diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index 4bb7196eae..fe72cb81a5 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -940,7 +940,9 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ fi dnl clang 19 or later if test "$compiler_num" -ge "1901"; then - tmp_CFLAGS="$tmp_CFLAGS -Wno-format-signedness" + CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [format-signedness]) + tmp_CFLAGS="$tmp_CFLAGS -Wno-error=format-signedness" + tmp_CFLAGS="$tmp_CFLAGS -Wno-error=format" fi dnl clang 20 or later if test "$compiler_num" -ge "2001"; then @@ -1134,7 +1136,9 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ dnl Only gcc 5 or later if test "$compiler_num" -ge "500"; then tmp_CFLAGS="$tmp_CFLAGS -Warray-bounds=2" - tmp_CFLAGS="$tmp_CFLAGS -Wno-format-signedness" + CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [format-signedness]) + tmp_CFLAGS="$tmp_CFLAGS -Wno-error=format-signedness" + tmp_CFLAGS="$tmp_CFLAGS -Wno-error=format" fi dnl Only gcc 6 or later