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

url: silence MSVC warning #5638

Merged
merged 1 commit into from Jul 2, 2020
Merged

url: silence MSVC warning #5638

merged 1 commit into from Jul 2, 2020

Conversation

@MarcelRaad
Copy link
Member

MarcelRaad commented Jul 2, 2020

Since commit f3d501d, if proxy support is disabled, MSVC warns:
url.c : warning C4701: potentially uninitialized local variable
'hostaddr' used
url.c : error C4703: potentially uninitialized local pointer variable
'hostaddr' used

That could actually only happen if both conn->bits.proxy and
CURL_DISABLE_PROXY were enabled.
Initialize it to NULL to silence the warning.

Since commit f3d501d, if proxy support is disabled, MSVC warns:
url.c : warning C4701: potentially uninitialized local variable
'hostaddr' used
url.c : error C4703: potentially uninitialized local pointer variable
'hostaddr' used

That could actually only happen if both `conn->bits.proxy` and
`CURL_DISABLE_PROXY` were enabled.
Initialize it to NULL to silence the warning.

Closes #5638
@MarcelRaad MarcelRaad force-pushed the MarcelRaad:url_msvc_warning branch from 1ffb468 to 19b96ba Jul 2, 2020
@bagder
bagder approved these changes Jul 2, 2020
@MarcelRaad MarcelRaad closed this in 19b96ba Jul 2, 2020
@MarcelRaad MarcelRaad merged commit 19b96ba into curl:master Jul 2, 2020
43 of 46 checks passed
43 of 46 checks passed
fuzzing
Details
macos normal
Details
CodeQL-Build
Details
macos debug
Details
macos libssh2
Details
macos c-ares
Details
macos HTTP only
Details
macos SecureTransport metalink
Details
macos OpenSSL metalink
Details
macos LibreSSL metalink
Details
macos torture
Details
macos cmake clang OpenSSL
Details
macos cmake clang LibreSSL
Details
macos cmake gcc-8 OpenSSL
Details
macos cmake gcc-8 LibreSSL
Details
macos cmake gcc-9 OpenSSL
Details
macos cmake gcc-9 LibreSSL
Details
curl.curl Build #20200702.4 failed
Details
curl.curl (windows windows msys2_mingw32_debug_schannel) windows windows msys2_mingw32_debug_schannel failed
Details
curl.curl (windows windows msys2_mingw64_debug_schannel) windows windows msys2_mingw64_debug_schannel failed
Details
LGTM analysis: Python No code changes detected
Details
CodeQL No new alerts
Details
FreeBSD FreeBSD:freebsd-11-3-snap Task Summary
Details
FreeBSD FreeBSD:freebsd-12-1 Task Summary
Details
LGTM analysis: C/C++ No new or fixed alerts
Details
buildbot/curl_winssl_cross_x64 Build done.
Details
buildbot/curl_winssl_cross_x64_dbg Build done.
Details
buildbot/curl_winssl_cross_x86 Build done.
Details
buildbot/curl_winssl_cross_x86_dbg Build done.
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
curl.curl (linux ubuntu default) linux ubuntu default succeeded
Details
curl.curl (linux ubuntu disable_http_smtp_imap) linux ubuntu disable_http_smtp_imap succeeded
Details
curl.curl (linux ubuntu disable_ipv6) linux ubuntu disable_ipv6 succeeded
Details
curl.curl (linux ubuntu disable_thredres) linux ubuntu disable_thredres succeeded
Details
curl.curl (linux ubuntu http_only) linux ubuntu http_only succeeded
Details
curl.curl (linux ubuntu torture) linux ubuntu torture succeeded
Details
curl.curl (windows windows msys1_mingw32_debug_openssl) windows windows msys1_mingw32_debug_openssl succeeded
Details
curl.curl (windows windows msys1_mingw32_debug_schannel) windows windows msys1_mingw32_debug_schannel succeeded
Details
curl.curl (windows windows msys1_mingw64_debug_openssl) windows windows msys1_mingw64_debug_openssl succeeded
Details
curl.curl (windows windows msys1_mingw64_debug_schannel) windows windows msys1_mingw64_debug_schannel succeeded
Details
curl.curl (windows windows msys1_mingw_debug_openssl) windows windows msys1_mingw_debug_openssl succeeded
Details
curl.curl (windows windows msys1_mingw_debug_schannel) windows windows msys1_mingw_debug_schannel succeeded
Details
curl.curl (windows windows msys2_mingw32_debug_openssl) windows windows msys2_mingw32_debug_openssl succeeded
Details
curl.curl (windows windows msys2_mingw64_debug_openssl) windows windows msys2_mingw64_debug_openssl succeeded
Details
deepcode-ci-bot Well done, no issues found!
Details
@MarcelRaad MarcelRaad deleted the MarcelRaad:url_msvc_warning branch Jul 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.