build: enable -Wlogical-op picky warning for GCC 4.4+

This commit is contained in:
Viktor Szakats 2026-06-06 14:24:29 +02:00
parent 879a1514c3
commit 72f2ab5f1e
No known key found for this signature in database
2 changed files with 6 additions and 0 deletions

View file

@ -300,6 +300,7 @@ if(PICKY_COMPILER)
list(APPEND _picky_enable
-Wdouble-promotion # clang 3.6 gcc 4.6 appleclang 6.1
-Wformat=2 # clang 2.7 gcc 4.8
-Wlogical-op # gcc 4.4
-Wtrampolines # gcc 4.6
)
endif()

View file

@ -1115,6 +1115,11 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [
tmp_CFLAGS="$tmp_CFLAGS -ftree-vrp"
fi
dnl Only gcc 4.4 or later
if test "$compiler_num" -ge "404"; then
CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [logical-op])
fi
dnl Only gcc 4.5 or later
if test "$compiler_num" -ge "405"; then
CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [jump-misses-init])