diff --git a/CMake/PickyWarnings.cmake b/CMake/PickyWarnings.cmake index fff4deddc9..96729c9cb4 100644 --- a/CMake/PickyWarnings.cmake +++ b/CMake/PickyWarnings.cmake @@ -147,7 +147,7 @@ if(PICKY_COMPILER) list(APPEND _picky_enable ${_picky_common_old} -Wconditional-uninitialized # clang 3.0 - -Wno-used-but-marked-unused # clang 3.0 # Triggered by typecheck-gcc.h (with clang 14+) + -Wno-used-but-marked-unused # clang 3.0 # Triggered by typecheck-gcc.h with clang 14+, dependency headers -Wshift-sign-overflow # clang 2.9 -Wshorten-64-to-32 # clang 1.0 -Wformat=2 # clang 3.0 gcc 4.8 @@ -161,7 +161,7 @@ if(PICKY_COMPILER) if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.1) list(APPEND _picky_enable -Wno-covered-switch-default # clang 3.1 appleclang 3.1 # Annoying to fix or silence - -Wno-disabled-macro-expansion # clang 3.1 appleclang 3.1 # Triggered by typecheck-gcc.h (with clang 14+) + -Wno-disabled-macro-expansion # clang 3.1 appleclang 3.1 # Triggered by standard headers ) if(MSVC) list(APPEND _picky_enable diff --git a/include/curl/curl.h b/include/curl/curl.h index f14f887261..e2c1c5d39d 100644 --- a/include/curl/curl.h +++ b/include/curl/curl.h @@ -3329,10 +3329,14 @@ CURL_EXTERN CURLcode curl_easy_ssls_export(CURL *handle, /* This preprocessor magic that replaces a call with the exact same call is only done to make sure application authors pass exactly three arguments to these functions. */ -#define curl_easy_setopt(handle,opt,param) curl_easy_setopt(handle,opt,param) -#define curl_easy_getinfo(handle,info,arg) curl_easy_getinfo(handle,info,arg) -#define curl_share_setopt(share,opt,param) curl_share_setopt(share,opt,param) -#define curl_multi_setopt(handle,opt,param) curl_multi_setopt(handle,opt,param) +#define curl_easy_setopt(handle, opt, param) \ + (curl_easy_setopt)(handle, opt, param) +#define curl_easy_getinfo(handle, info, arg) \ + (curl_easy_getinfo)(handle, info, arg) +#define curl_share_setopt(share, opt, param) \ + (curl_share_setopt)(share, opt, param) +#define curl_multi_setopt(handle,opt,param) \ + (curl_multi_setopt)(handle, opt, param) #endif /* __STDC__ >= 1 */ #endif /* gcc >= 4.3 && !__cplusplus && !CURL_DISABLE_TYPECHECK */ diff --git a/include/curl/typecheck-gcc.h b/include/curl/typecheck-gcc.h index 0642afd91e..7e6ef5baf4 100644 --- a/include/curl/typecheck-gcc.h +++ b/include/curl/typecheck-gcc.h @@ -156,7 +156,7 @@ Wcurl_easy_setopt_err_CURLSH(); \ ) \ } \ - curl_easy_setopt(handle, option, value); \ + (curl_easy_setopt)(handle, option, value); \ }) /* wraps curl_easy_getinfo() with type checking */ @@ -190,7 +190,7 @@ Wcurl_easy_getinfo_err_curl_off_t(); \ ) \ } \ - curl_easy_getinfo(handle, info, arg); \ + (curl_easy_getinfo)(handle, info, arg); \ }) #define curl_multi_setopt(handle, option, value) \ @@ -221,7 +221,7 @@ if(!curlcheck_multitimer_cb(value)) \ Wcurl_multi_setopt_err_timercb(); \ } \ - curl_multi_setopt(handle, option, value); \ + (curl_multi_setopt)(handle, option, value); \ }) /* evaluates to true if the option takes a data argument to pass to a @@ -262,7 +262,8 @@ /* * For now, just make sure that the functions are called with three arguments */ -#define curl_share_setopt(share,opt,param) curl_share_setopt(share,opt,param) +#define curl_share_setopt(share, opt, param) \ + (curl_share_setopt)(share, opt, param) /* the actual warnings, triggered by calling the Wcurl_easy_setopt_err* * functions */ diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index 3335a74cd6..c23845e197 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -862,13 +862,13 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [conditional-uninitialized]) CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [language-extension-token]) tmp_CFLAGS="$tmp_CFLAGS -Wformat=2" - tmp_CFLAGS="$tmp_CFLAGS -Wno-used-but-marked-unused" # Triggered by typecheck-gcc.h (with clang 14+) + tmp_CFLAGS="$tmp_CFLAGS -Wno-used-but-marked-unused" # Triggered by typecheck-gcc.h with clang 14+, dependency headers fi dnl Only clang 3.1 or later if test "$compiler_num" -ge "301"; then CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [format-non-iso]) tmp_CFLAGS="$tmp_CFLAGS -Wno-covered-switch-default" # Annoying to fix or silence - tmp_CFLAGS="$tmp_CFLAGS -Wno-disabled-macro-expansion" # Triggered by typecheck-gcc.h (with clang 14+) + tmp_CFLAGS="$tmp_CFLAGS -Wno-disabled-macro-expansion" # Triggered by standard headers fi # dnl Only clang 3.2 or later