Skip to content

fix build error on windows#674

Open
AvenSun wants to merge 1 commit intosctplab:masterfrom
AvenSun:AvenSun-patch-1
Open

fix build error on windows#674
AvenSun wants to merge 1 commit intosctplab:masterfrom
AvenSun:AvenSun-patch-1

Conversation

@AvenSun
Copy link
Copy Markdown

@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
Copy Markdown
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
Copy Markdown
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
Copy Markdown

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.

3 participants