In client.c we were mistakenly typing the verify callback as returning enum rustls_result when it should be uint32_t. This commit makes the required adjustment, silencing the warning.
server.c
On Linux, man 2 setsockopt shows the optval argument as being const void *. On Windows, setsockopt's optval argument is const char*. This mismatch produces an incompatible types warning when building the server.c example on Windows.
The solution is straight-forward. Explicitly cast optval to const char*. On Windows this is the correct type. On Linux it will be implicitly converted to const void * and everyone is happy.
Resolves https://github.com/rustls/rustls-ffi/issues/235
client.c
The
rustls_verify_server_cert_callback
type is defined as returninguint32_t
.In
client.c
we were mistakenly typing theverify
callback as returningenum rustls_result
when it should beuint32_t
. This commit makes the required adjustment, silencing the warning.server.c
On Linux,
man 2 setsockopt
shows theoptval
argument as beingconst void *
. On Windows,setsockopt
'soptval
argument isconst char*
. This mismatch produces an incompatible types warning when building theserver.c
example on Windows.The solution is straight-forward. Explicitly cast
optval
toconst char*
. On Windows this is the correct type. On Linux it will be implicitly converted toconst void *
and everyone is happy.