]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/patches/curl-7.87.0_typecheck_accept_expressions_for_option_info_parameters.patch
suricata: Change midstream policy to "pass-flow"
[people/pmueller/ipfire-2.x.git] / src / patches / curl-7.87.0_typecheck_accept_expressions_for_option_info_parameters.patch
1 From curl commit e2aed00
2
3 As expressions can have side effects, evaluate only once.
4
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.
9
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.
13
14 Reported-by: Thomas Klausner
15 Fixes #10148
16 Closes #10149
17
18
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
21 @@ -42,9 +42,8 @@
22 */
23 #define curl_easy_setopt(handle, option, value) \
24 __extension__({ \
25 - CURL_IGNORE_DEPRECATION(__typeof__(option) _curl_opt = option;) \
26 + CURLoption _curl_opt = (option); \
27 if(__builtin_constant_p(_curl_opt)) { \
28 - (void) option; \
29 CURL_IGNORE_DEPRECATION( \
30 if(curlcheck_long_option(_curl_opt)) \
31 if(!curlcheck_long(value)) \
32 @@ -120,9 +119,8 @@
33 /* wraps curl_easy_getinfo() with typechecking */
34 #define curl_easy_getinfo(handle, info, arg) \
35 __extension__({ \
36 - CURL_IGNORE_DEPRECATION(__typeof__(info) _curl_info = info;) \
37 + CURLINFO _curl_info = (info); \
38 if(__builtin_constant_p(_curl_info)) { \
39 - (void) info; \
40 CURL_IGNORE_DEPRECATION( \
41 if(curlcheck_string_info(_curl_info)) \
42 if(!curlcheck_arr((arg), char *)) \