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 all MSVC warnings #3495

Merged
merged 4 commits into from
Feb 11, 2023
Merged

Fix all MSVC warnings #3495

merged 4 commits into from
Feb 11, 2023

Conversation

embg
Copy link
Contributor

@embg embg commented Feb 10, 2023

@embg
Copy link
Contributor Author

embg commented Feb 10, 2023

It looks like my second commit, adding /warnaserror (the msbuild equivalent of -Werror), exposed a warning in the MSVC 2019 build. Will investigate ASAP.

@embg
Copy link
Contributor Author

embg commented Feb 10, 2023

The MSVC 2019 build warnings were introduced by #3449. The errors are all caused by memcpy operations from BYTE const * * to BYTE const * *. The compiler incorrectly believes the const qualifiers don't match.

This warning doesn't show up in the MSVC 2022 build, so I think it is a bug in MSVC 2019.

Example warning (which is an error now that we have /warnaserror): https://github.com/facebook/zstd/actions/runs/4147381724/jobs/7174208209#step:4:207

Fixed by adding void* casts to the destination of each offending memcpy.

@embg embg changed the title Fix and test MSVC AVX2 build Fix all MSVC warnings Feb 10, 2023
@embg embg marked this pull request as ready for review February 10, 2023 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MSVC with AVX2 compile option, C4244 warnings.
3 participants