]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
build: drop macro used to enable `-Wsign-conversion` warnings in CI
authorViktor Szakats <commit@vsz.me>
Mon, 3 Feb 2025 18:31:10 +0000 (19:31 +0100)
committerViktor Szakats <commit@vsz.me>
Mon, 3 Feb 2025 21:28:08 +0000 (22:28 +0100)
We don't pursue this, and the necessary `#pragma` got in the way of
compiling curl with gcc 4.2 and older. Drop the logic completely.

Follow-up to 8a266ac4883958c339fe16796081a296cd66acb3 #15939

Reported-by: prpr19xx on Github
Fixes #16152
Closes #16157

.github/workflows/linux.yml
CMake/PickyWarnings.cmake
lib/curl_setup.h
m4/curl-compilers.m4

index 6274d100d60ab4ab1b30e85a92570900691dc93c..1f66eeb9d2c3ad3783dfd78744cb94fe183a7290 100644 (file)
@@ -172,7 +172,7 @@ jobs:
 
           - name: openssl -O3 valgrind
             install_packages: zlib1g-dev valgrind
-            configure: CPPFLAGS=-DCURL_WARN_SIGN_CONVERSION CFLAGS=-O3 --with-openssl --enable-debug
+            configure: CFLAGS=-O3 --with-openssl --enable-debug
 
           - name: openssl clang krb5
             install_packages: zlib1g-dev libkrb5-dev clang
index 7abba373e609e52ad30cc901c5288f19d9c6af8c..23341c49b8b51568f1edae75a277528b49d19a78 100644 (file)
@@ -103,12 +103,11 @@ if(PICKY_COMPILER)
       -Wmissing-field-initializers         # clang  2.7  gcc  4.1
       -Wmissing-noreturn                   # clang  2.7  gcc  4.1
       -Wno-format-nonliteral               # clang  1.0  gcc  2.96 (3.0)
+      -Wno-sign-conversion                 # clang  2.9  gcc  4.3
       -Wno-system-headers                  # clang  1.0  gcc  3.0
     # -Wpadded                             # clang  2.9  gcc  4.1               # Not used: We cannot change public structs
       -Wold-style-definition               # clang  2.7  gcc  3.4
       -Wredundant-decls                    # clang  2.7  gcc  4.1
-      -Wsign-conversion                    # clang  2.9  gcc  4.3
-        -Wno-error=sign-conversion
       -Wstrict-prototypes                  # clang  1.0  gcc  3.3
     # -Wswitch-enum                        # clang  2.7  gcc  4.1               # Not used: It basically disallows default case
       -Wtype-limits                        # clang  2.7  gcc  4.3
index cc1b7e55dae046cb3aabb06a1aec96ab680b7792..f4e5400119b78ee8c562227e674734a3439457b6 100644 (file)
 /* Tell "curl/curl.h" not to include "curl/mprintf.h" */
 #define CURL_SKIP_INCLUDE_MPRINTF
 
-/* Make these warnings visible with an option. */
-#if !defined(CURL_WARN_SIGN_CONVERSION)
-#if defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic ignored "-Wsign-conversion"
-#endif
-#endif
-
 /* Set default _WIN32_WINNT */
 #ifdef __MINGW32__
 #include <_mingw.h>
index 6f726a9a5f24e3ad6379c629ae24180a2b2070ff..9339187efc467b60a8ae82aebbd376f44b6c6de1 100644 (file)
@@ -843,8 +843,7 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [
           #
           dnl Only clang 2.9 or later
           if test "$compiler_num" -ge "209"; then
-            CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [sign-conversion])
-            tmp_CFLAGS="$tmp_CFLAGS -Wno-error=sign-conversion"
+            tmp_CFLAGS="$tmp_CFLAGS -Wno-sign-conversion"
             CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [shift-sign-overflow])
           # CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [padded])  # Not used because we cannot change public structs
           fi
@@ -1031,8 +1030,7 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [
             CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [missing-parameter-type empty-body])
             CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [clobbered ignored-qualifiers])
             CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [conversion])
-            CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [sign-conversion])
-            tmp_CFLAGS="$tmp_CFLAGS -Wno-error=sign-conversion"
+            tmp_CFLAGS="$tmp_CFLAGS -Wno-sign-conversion"
             CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [vla])
             dnl required for -Warray-bounds, included in -Wall
             tmp_CFLAGS="$tmp_CFLAGS -ftree-vrp"