Skip to content

Commit

Permalink
build: enable -Wjump-misses-init for GCC 4.5+
Browse files Browse the repository at this point in the history
This should have caught curl#16246.

Closes curl#16252
  • Loading branch information
MarcelRaad committed Feb 17, 2025
1 parent d164f49 commit db4d617
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
10 changes: 8 additions & 2 deletions CMake/PickyWarnings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions m4/curl-compilers.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit db4d617

Please sign in to comment.