← Commit list

7e2b15ee56

Viktor Szakats
Viktor Szakats
2025-12-18
SUCCESS Duration: 202s

Subject

build: replace `-pedantic` with `-Wpedantic` when supported

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

CMake/PickyWarnings.cmake+9 -3
@@ -75,9 +75,15 @@ if(PICKY_COMPILER)
set(_picky_enable "-W")
endif()
- list(APPEND _picky_enable
- -Wall -pedantic
- )
+ list(APPEND _picky_enable "-Wall")
+
+ if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.2) OR
+ (CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.2) OR
+ CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8)
+ list(APPEND _picky_enable "-Wpedantic") # clang 3.2 gcc 4.8 appleclang 4.2
+ else()
+ list(APPEND _picky_enable "-pedantic")
+ endif()
# ----------------------------------
# Add new options here, if in doubt:
m4/curl-compilers.m4+11 -3
@@ -796,7 +796,11 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [
CLANG|APPLECLANG)
#
if test "$want_warnings" = "yes"; then
- tmp_CFLAGS="$tmp_CFLAGS -pedantic"
+ if test "$compiler_num" -ge "302"; then
+ CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [pedantic])
+ else
+ tmp_CFLAGS="$tmp_CFLAGS -pedantic"
+ fi
CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [all extra])
CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [pointer-arith write-strings])
CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [shadow])
@@ -974,8 +978,12 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [
dnl Do not enable -pedantic when cross-compiling with a gcc older
dnl than 3.0, to avoid warnings from third party system headers.
if test "$cross_compiling" != "yes" ||
- test "$compiler_num" -ge "300"; then
- tmp_CFLAGS="$tmp_CFLAGS -pedantic"
+ test "$compiler_num" -ge "300"; then
+ if test "$compiler_num" -ge "408"; then
+ CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [pedantic])
+ else
+ tmp_CFLAGS="$tmp_CFLAGS -pedantic"
+ fi
fi
#
dnl Set of options we believe *ALL* gcc versions support: