diff --git a/CMake/PickyWarnings.cmake b/CMake/PickyWarnings.cmake index d1183fe392..96e45f0e8c 100644 --- a/CMake/PickyWarnings.cmake +++ b/CMake/PickyWarnings.cmake @@ -33,6 +33,16 @@ if(CURL_WERROR AND set(WPICKY "${WPICKY} -pedantic-errors") endif() +if(APPLE AND + (CMAKE_C_COMPILER_ID STREQUAL "Clang" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.6) OR + (CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 6.3)) + set(WPICKY "${WPICKY} -Werror=partial-availability") # clang 3.6 appleclang 6.3 +endif() + +if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang") + set(WPICKY "${WPICKY} -Werror-implicit-function-declaration") # clang 1.0 gcc 2.95 +endif() + if(PICKY_COMPILER) if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang") diff --git a/configure.ac b/configure.ac index 91565c972d..0ea0c16d17 100644 --- a/configure.ac +++ b/configure.ac @@ -540,6 +540,8 @@ if test X"$want_werror" = Xyes; then if test "$compiler_num" -ge "500"; then CURL_CFLAG_EXTRAS="$CURL_CFLAG_EXTRAS -pedantic-errors" fi + elif test "$compiler_id" = "CLANG"; then + CURL_CFLAG_EXTRAS="$CURL_CFLAG_EXTRAS -pedantic-errors" fi fi AC_SUBST(CURL_CFLAG_EXTRAS) @@ -5023,6 +5025,7 @@ AC_MSG_NOTICE([Configured to build curl/libcurl: Install prefix: ${prefix} Compiler: ${CC} CFLAGS: ${CFLAGS} + CFLAGS extras: ${CURL_CFLAG_EXTRAS} CPPFLAGS: ${CPPFLAGS} LDFLAGS: ${LDFLAGS} LIBS: ${LIBS} diff --git a/lib/vtls/sectransp.c b/lib/vtls/sectransp.c index 4868395c53..89993b1719 100644 --- a/lib/vtls/sectransp.c +++ b/lib/vtls/sectransp.c @@ -43,6 +43,7 @@ #ifdef __clang__ #pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wpointer-bool-conversion" #pragma clang diagnostic ignored "-Wtautological-pointer-compare" #endif /* __clang__ */ diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index 06cf1b2177..001e5f4aa4 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -519,6 +519,7 @@ AC_DEFUN([CURL_SET_COMPILER_BASIC_OPTS], [ dnl warn about compile-time arguments used during link-time, like dnl -O and -g and -pedantic. tmp_CFLAGS="$tmp_CFLAGS -Qunused-arguments" + tmp_CFLAGS="$tmp_CFLAGS -Werror-implicit-function-declaration" ;; # DEC_C) @@ -897,10 +898,6 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ tmp_CFLAGS="$tmp_CFLAGS -Wimplicit-fallthrough" # we have silencing markup for clang 10.0 and above only fi fi - dnl Disable pointer to bool conversion warnings since they cause - dnl lib/securetransp.c cause several warnings for checks we want. - dnl This option should be placed after -Wconversion. - tmp_CFLAGS="$tmp_CFLAGS -Wno-pointer-bool-conversion" ;; # DEC_C)