mirror of
https://github.com/curl/curl.git
synced 2026-04-11 12:01:42 +08:00
build: enable -Wimplicit-int-enum-cast compiler warning, fix issues
Offered by clang 21+. Closes #20990
This commit is contained in:
parent
d86fd143a1
commit
59405ffb7d
@ -258,6 +258,7 @@ if(PICKY_COMPILER)
|
||||
list(APPEND _picky_enable
|
||||
-Warray-compare # clang 20.1 gcc 12.0 appleclang 26.4
|
||||
-Wc++-hidden-decl # clang 21.1 appleclang 26.4
|
||||
-Wimplicit-int-enum-cast # clang 21.1
|
||||
-Wjump-misses-init # clang 21.1 gcc 4.5 appleclang 26.4
|
||||
-Wno-implicit-void-ptr-cast # clang 21.1 appleclang 26.4
|
||||
-Wtentative-definition-compat # clang 21.1 appleclang 26.4
|
||||
|
||||
@ -1157,7 +1157,7 @@ static CURLcode ssh_state_pkey_init(struct Curl_easy *data,
|
||||
else {
|
||||
myssh_to(data, sshc, SSH_AUTH_PASS_INIT);
|
||||
}
|
||||
return 0;
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
static CURLcode sftp_quote_stat(struct Curl_easy *data,
|
||||
|
||||
@ -952,6 +952,7 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [
|
||||
dnl clang 21 or later
|
||||
if test "$compiler_num" -ge "2101"; then
|
||||
CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [c++-hidden-decl])
|
||||
CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [implicit-int-enum-cast])
|
||||
CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [jump-misses-init])
|
||||
tmp_CFLAGS="$tmp_CFLAGS -Wno-implicit-void-ptr-cast"
|
||||
CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [tentative-definition-compat])
|
||||
|
||||
@ -175,7 +175,8 @@ static int my_progress_d_cb(void *userdata,
|
||||
#endif
|
||||
#ifdef USE_GNUTLS
|
||||
case CURLSSLBACKEND_GNUTLS: {
|
||||
int v = gnutls_protocol_get_version((gnutls_session_t)tls->internals);
|
||||
gnutls_protocol_t v = gnutls_protocol_get_version(
|
||||
(gnutls_session_t)tls->internals);
|
||||
assert(v);
|
||||
curl_mfprintf(stderr, "[t-%zu] info GnuTLS using %s\n",
|
||||
t->idx, gnutls_protocol_get_name(v));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user