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

fix build error on windows #674

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AvenSun
Copy link

@AvenSun AvenSun commented May 4, 2023

sctp_output.c
L:\usrsctplib\netinet\sctp_output.c(14823): error C2220: the following warning is treated as an error
L:\usrsctplib\netinet\sctp_output.c(14823): warning C4703: potentially uninitialized local pointer variable 'inp' used
L:\usrsctplib\netinet\sctp_output.c(14827): warning C4703: potentially uninitialized local pointer variable 'asoc' used

sctp_output.c
L:\usrsctplib\netinet\sctp_output.c(14823): error C2220: the following warning is treated as an error
L:\usrsctplib\netinet\sctp_output.c(14823): warning C4703: potentially uninitialized local pointer variable 'inp' used
L:\usrsctplib\netinet\sctp_output.c(14827): warning C4703: potentially uninitialized local pointer variable 'asoc' used
@tuexen
Copy link
Member

tuexen commented May 23, 2023

Can you show me a possibility how the variable can be use uninitialized? Right now my understanding is that this is a false positive of the Windows compiler. Neither gcc nor clang nor other static code analyzers report a problem...

@AvenSun
Copy link
Author

AvenSun commented May 23, 2023

Hi, @tuexen
actually there's no modification of the code.
Just pull and build as a static library on windows via visual studio 2019.
image
If we don't initialize these two variables during its declaration,
visual studio will raise an error and interrupt the compilation process.
It might be a false positive of visual studio.
I 've no idea why the other uninitialized variables didn't result in this error.
but I think initialization might be more straightforward compared to change the setting of visual studio.

@garbear
Copy link

garbear commented Aug 6, 2023

This fixes building on win32/win64/UWP32/UWP64/UWP-arm for me.

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.

None yet

3 participants