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 compilation of MathExtras.h on Windows with /sdl #5809

Merged
merged 2 commits into from
Oct 24, 2023

Conversation

bhall-ctre
Copy link
Contributor

On Windows, compilation fails with error C4146 on the MathExtras.h header when using the /sdl compiler flag. Since unary minus performs two's complement, it is equivalent to performing ones' complement (bitwise NOT) on the unsigned number and adding one.

This fix was copied from the LLVM main branch: llvm/llvm-project#68978

Fix copied from the LLVM main branch
ThadHouse
ThadHouse previously approved these changes Oct 24, 2023
@sciencewhiz
Copy link
Contributor

This should be done as a patch in upstream_utils, not by modifying the llvm source. https://github.com/wpilibsuite/allwpilib/tree/main/upstream_utils#adding-patch-to-thirdparty-library

I reverted the previous file changes locally and ran the python script with
the latest patch and confirmed that there were no changes compared to the
MathExtras.h header compared to the previous commit.
@PeterJohnson PeterJohnson merged commit 63ef585 into wpilibsuite:main Oct 24, 2023
23 of 24 checks passed
@bhall-ctre bhall-ctre deleted the windows_compile_fix branch October 24, 2023 14:54
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.

5 participants