1 From curl commit e2aed00
3 As expressions can have side effects, evaluate only once.
5 To enable deprecation reporting only once, get rid of the __typeof__
6 use to define the local temporary variable and use the target type
7 (CURLoption/CURLINFO). This also avoids multiple reports on type
8 conflicts (if some) by the curlcheck_* macros.
10 Note that CURLOPT_* and CURLINFO_* symbols may be deprecated, but not
11 their values: a curl_easy_setopt call with an integer constant as option
12 will never report a deprecation.
14 Reported-by: Thomas Klausner
19 --- curl-7.87.0/include/curl/typecheck-gcc.h.orig 2022-12-19 08:48:23.000000000 +0100
20 +++ curl-7.87.0/include/curl/typecheck-gcc.h 2022-12-26 20:39:29.243819395 +0100
23 #define curl_easy_setopt(handle, option, value) \
25 - CURL_IGNORE_DEPRECATION(__typeof__(option) _curl_opt = option;) \
26 + CURLoption _curl_opt = (option); \
27 if(__builtin_constant_p(_curl_opt)) { \
29 CURL_IGNORE_DEPRECATION( \
30 if(curlcheck_long_option(_curl_opt)) \
31 if(!curlcheck_long(value)) \
33 /* wraps curl_easy_getinfo() with typechecking */
34 #define curl_easy_getinfo(handle, info, arg) \
36 - CURL_IGNORE_DEPRECATION(__typeof__(info) _curl_info = info;) \
37 + CURLINFO _curl_info = (info); \
38 if(__builtin_constant_p(_curl_info)) { \
40 CURL_IGNORE_DEPRECATION( \
41 if(curlcheck_string_info(_curl_info)) \
42 if(!curlcheck_arr((arg), char *)) \