rustls / rustls-ffi

Use Rustls from any language
Other
124 stars 31 forks source link

tests: fix maybe-uninitialized warning #386

Closed cpu closed 5 months ago

cpu commented 5 months ago

I noticed there was a build warning in the test code while checking if there are any required updates to support building with rustls 0.23.0-alpha.0 (there aren't).

[daniel@blanc:~/Code/Rust/rustls-ffi]$ make test
gcc -o target/client.o -c tests/client.c -Werror -Wall -Wextra -Wpedantic -g -I src/ -O3
tests/client.c: In function ‘make_conn’:
tests/client.c:70:5: error: ‘connect_result’ may be used uninitialized [-Werror=maybe-uninitialized]
   70 |   if(connect_result < 0) {
      |     ^
tests/client.c:47:7: note: ‘connect_result’ was declared here
   47 |   int connect_result;
      |       ^~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make: *** [Makefile:47: target/client.o] Error 1