]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
build: fix `-Wtrampolines` picky warning for gcc 4.x versions
authorViktor Szakats <commit@vsz.me>
Fri, 10 Jan 2025 10:03:16 +0000 (11:03 +0100)
committerViktor Szakats <commit@vsz.me>
Fri, 10 Jan 2025 17:21:10 +0000 (18:21 +0100)
Caused an error when using cmake with gcc 4.4 and 4.5.
Also 4.3 when using autotools.

Seen with GNU 4.4.0 in CeGCC 0.59.1:
```
cc1: error: unrecognized command line option "-Wtrampolines"
```

`-Wtrampolines` requires gcc 4.6 or upper.

Ref: https://gcc.gnu.org/onlinedocs/gcc-4.6.0/gcc/Warning-Options.html
Ref: https://master.dl.sourceforge.net/project/cegcc/cegcc/0.59.1/cegcc_mingw32ce_snowleopard_r1397.tar.bz2

Closes #15962

CMake/PickyWarnings.cmake
m4/curl-compilers.m4

index cfe82b6db189b28ce3ab929f79384c398dfeb3e5..e3a5be25fa9bff25c1048df2a4ee9b3a89670667 100644 (file)
@@ -173,7 +173,6 @@ if(PICKY_COMPILER)
           -Wold-style-declaration          #             gcc  4.3
           -Wpragmas                        # clang  3.5  gcc  4.1  appleclang  6.0
           -Wstrict-aliasing=3              #             gcc  4.0
-          -Wtrampolines                    #             gcc  4.3
         )
       endif()
       if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.5 AND MINGW)
@@ -185,6 +184,7 @@ if(PICKY_COMPILER)
         list(APPEND _picky_enable
           -Wdouble-promotion               # clang  3.6  gcc  4.6  appleclang  6.3
           -Wformat=2                       # clang  3.0  gcc  4.8
+          -Wtrampolines                    #             gcc  4.6
         )
       endif()
       if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0)
index bb20b6ced9ed1724b8805340a4e3de37837a142a..4f3168feef8fcfac21d4c9775503c652effaaf45 100644 (file)
@@ -1030,7 +1030,7 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [
             CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [type-limits old-style-declaration])
             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 trampolines])
+            CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [conversion])
             CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [sign-conversion])
             tmp_CFLAGS="$tmp_CFLAGS -Wno-error=sign-conversion"
             CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [vla])
@@ -1055,6 +1055,7 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [
           dnl Only gcc 4.6 or later
           if test "$compiler_num" -ge "406"; then
             CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [double-promotion])
+            CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [trampolines])
           fi
           #
           dnl only gcc 4.8 or later