You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
to avoid gratuitous casting from void* to SSL_CTX*. GCC 10.2.0 compiles this without warnings on -O0, but with optimization enabled it produces a typecheck warning:
In file included from ../curl/include/curl/curl.h:3024,
from daemon/main.c:17:
daemon/main.c: In function '_setup_ssl_curl':
../curl/include/curl/typecheck-gcc.h:80:13: warning: call to '_curl_easy_setopt_err_ssl_ctx_cb' declared with attribute warning: curl_easy_setopt expects a curl_ssl_ctx_callback argument for this option [-Wattribute-warning]
80 | _curl_easy_setopt_err_ssl_ctx_cb(); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../curl/include/curl/typecheck-gcc.h:80:13: note: in definition of macro 'curl_easy_setopt'
80 | _curl_easy_setopt_err_ssl_ctx_cb(); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
and of course with -Werror on compilation fails. Confusingly, GCC 9.3.0 on Linux compiles the same input without warnings regardless of optimization setting. The root cause appears to be that the callback declarations in curl/typecheck-gcc.h take SSL_CTX by value, whereas the actual callsite passes the SSL context by pointer, as it should (since SSL_CTX is an opaque struct). This issue is similar to #5432.
curl/libcurl version
libcurl 7.75.0
operating system
MINGW64_NT-10.0-1xxxxx REDACTED x86_64 Msys
gcc.exe (Rev9, Built by MSYS2 project) 10.2.0
The text was updated successfully, but these errors were encountered:
I am calling
curl_easy_setopt
to set an SSL context callback to use an in-memory CA store. My callback is declared asto avoid gratuitous casting from
void*
toSSL_CTX*
. GCC 10.2.0 compiles this without warnings on -O0, but with optimization enabled it produces a typecheck warning:and of course with
-Werror
on compilation fails. Confusingly, GCC 9.3.0 on Linux compiles the same input without warnings regardless of optimization setting. The root cause appears to be that the callback declarations in curl/typecheck-gcc.h takeSSL_CTX
by value, whereas the actual callsite passes the SSL context by pointer, as it should (sinceSSL_CTX
is an opaque struct). This issue is similar to #5432.curl/libcurl version
libcurl 7.75.0
operating system
The text was updated successfully, but these errors were encountered: