diff options
author | Viktor Szakats <commit@vsz.me> | 2022-10-26 09:56:52 +0000 |
---|---|---|
committer | Viktor Szakats <commit@vsz.me> | 2022-10-26 09:56:52 +0000 |
commit | 811c799f2db1bbcf22e7ceee1e8c2c21525274de (patch) | |
tree | c58e1a008113a373094536967499b0ac73e8ee36 /lib/vtls/schannel.c | |
parent | df77eff27871fc755f04d5d7dc1ba2b2133fcd04 (diff) | |
download | curl-811c799f2db1bbcf22e7ceee1e8c2c21525274de.tar.gz |
cmake: really enable warnings with clang
Even though `PICKY_COMPILER=ON` is the default, warnings were not
enabled when using llvm/clang, because `CMAKE_COMPILER_IS_CLANG` was
always false (in my tests at least).
This is the single use of this variable in curl, and in a different
place we already use `CMAKE_C_COMPILER_ID MATCHES "Clang"`, which works
as expected, so change the condition to use that instead.
Also fix the warnings uncovered by the above:
- lib: add casts to silence clang warnings
- schannel: add casts to silence clang warnings in ALPN code
Assuming the code is correct, solve the warnings with a cast.
This particular build case isn't CI tested.
There is a chance the warning is relevant for some platforms, perhaps
Windows 32-bit ARM7.
Closes #9783
Diffstat (limited to 'lib/vtls/schannel.c')
-rw-r--r-- | lib/vtls/schannel.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/vtls/schannel.c b/lib/vtls/schannel.c index 454eb7967..fcfb9c6df 100644 --- a/lib/vtls/schannel.c +++ b/lib/vtls/schannel.c @@ -1200,18 +1200,18 @@ schannel_connect_step1(struct Curl_easy *data, struct connectdata *conn, /* The first four bytes will be an unsigned int indicating number of bytes of data in the rest of the buffer. */ - extension_len = (unsigned int *)(&alpn_buffer[cur]); + extension_len = (unsigned int *)(void *)(&alpn_buffer[cur]); cur += sizeof(unsigned int); /* The next four bytes are an indicator that this buffer will contain ALPN data, as opposed to NPN, for example. */ - *(unsigned int *)&alpn_buffer[cur] = + *(unsigned int *)(void *)&alpn_buffer[cur] = SecApplicationProtocolNegotiationExt_ALPN; cur += sizeof(unsigned int); /* The next two bytes will be an unsigned short indicating the number of bytes used to list the preferred protocols. */ - list_len = (unsigned short*)(&alpn_buffer[cur]); + list_len = (unsigned short*)(void *)(&alpn_buffer[cur]); cur += sizeof(unsigned short); list_start_index = cur; |