]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
build: enable -Wjump-misses-init for GCC 4.5+ 16252/head
authorMarcel Raad <Marcel.Raad@teamviewer.com>
Fri, 7 Feb 2025 23:03:47 +0000 (00:03 +0100)
committerMarcel Raad <Marcel.Raad@teamviewer.com>
Mon, 17 Feb 2025 07:48:36 +0000 (08:48 +0100)
This should have caught https://github.com/curl/curl/issues/16246.

Closes https://github.com/curl/curl/pull/16252

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

index 2f1ddec67898534b639d0ee29422adfca7af99b0..b7bb20efe20f6995518d78eeb6d2025e8e873ace 100644 (file)
@@ -184,10 +184,16 @@ if(PICKY_COMPILER)
           -Wstrict-aliasing=3              #             gcc  4.0
         )
       endif()
-      if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.5 AND MINGW)
+      if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.5)
         list(APPEND _picky_enable
-          -Wno-pedantic-ms-format          #             gcc  4.5 (MinGW-only)
+          -Wjump-misses-init               #             gcc  4.5
         )
+
+        if(MINGW)
+          list(APPEND _picky_enable
+            -Wno-pedantic-ms-format        #             gcc  4.5 (MinGW-only)
+          )
+        endif()
       endif()
       if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.8)
         list(APPEND _picky_enable
index 49bcda0e88c2966f83631b8c3a7f3ee2d2814451..cbf7dc8a3b1045c74585aa10d772613f325470ce 100644 (file)
@@ -1040,6 +1040,7 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [
           #
           dnl Only gcc 4.5 or later
           if test "$compiler_num" -ge "405"; then
+            CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [jump-misses-init])
             dnl Only Windows targets
             if test "$curl_cv_native_windows" = "yes"; then
               tmp_CFLAGS="$tmp_CFLAGS -Wno-pedantic-ms-format"