Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: fix maybe-uninitialized warning #386

Merged
merged 1 commit into from
Feb 7, 2024
Merged

Conversation

cpu
Copy link
Member

@cpu cpu commented Feb 7, 2024

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

Fixes:

```
[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
```
@cpu cpu self-assigned this Feb 7, 2024
@cpu cpu merged commit 0678075 into rustls:main Feb 7, 2024
21 checks passed
@cpu cpu deleted the cpu-maybe-uninit-fix branch February 7, 2024 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants