We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Used clang-cl ver. 17.0.1 to compile libcurl with -DUSE_BEARSSL=1, gave these warnings for lib/vtls/bearssl.c:
-DUSE_BEARSSL=1
lib/vtls/bearssl.c
vtls/bearssl.c(160,7): warning: variable 'p' may be uninitialized when used here [-Wconditional-uninitialized] 160 | p += pushed; | ^ vtls/bearssl.c(123,25): note: initialize the variable 'p' to silence this warning 123 | const unsigned char *p; | ^ | = NULL vtls/bearssl.c(156,11): warning: variable 'n' may be uninitialized when used here [-Wconditional-uninitialized] 156 | while(n) { | ^ vtls/bearssl.c(125,11): note: initialize the variable 'n' to silence this warning 125 | size_t n, i, pushed; | ^ | = 0
My CFLAGS contained -Wall.
CFLAGS
-Wall
With this diff:
--- a/vtls/bearssl.c 2024-02-17 11:19:39 +++ b/vtls/bearssl.c 2024-04-01 06:41:42 @@ -120,9 +120,9 @@ br_x509_pkey *pkey; FILE *fp = 0; unsigned char buf[BUFSIZ]; - const unsigned char *p; + const unsigned char *p = NULL; const char *name; - size_t n, i, pushed; + size_t n = 0, i, pushed;
there are no warnings.
No warnings.
curl 8.7.2-DEV (x86_64-pc-win32) libcurl/8.7.2-DEV built from git master today.
curl 8.7.2-DEV (x86_64-pc-win32) libcurl/8.7.2-DEV
git master
Windows-10
The text was updated successfully, but these errors were encountered:
bearssl: fix compiler warnings
92b1167
"variables may be uninitialized when used" Fixes #13290
59bfc53
7567beb
"variables may be uninitialized when used" Fixes curl#13290 Closes curl#13297
Successfully merging a pull request may close this issue.
I did this
Used clang-cl ver. 17.0.1 to compile libcurl with
-DUSE_BEARSSL=1
, gave these warnings forlib/vtls/bearssl.c
:My
CFLAGS
contained-Wall
.With this diff:
there are no warnings.
I expected the following
No warnings.
curl/libcurl version
curl 8.7.2-DEV (x86_64-pc-win32) libcurl/8.7.2-DEV
built fromgit master
today.operating system
Windows-10
The text was updated successfully, but these errors were encountered: