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 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 curl#5638
@MarcelRaad MarcelRaad force-pushed the 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
Loading
@MarcelRaad MarcelRaad deleted the 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
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants