Skip to content

Runtimes: treat linker warnings as errors #78930

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

Merged
merged 1 commit into from
Jan 27, 2025

Conversation

compnerd
Copy link
Member

We were previously silently emitting incorrect code for the standard libraries and the warnings were being swallowed by the build system. This was brought to light by the new build system. The code generation issues have been addressed. In order to prevent a backslide, we would ideally use /WX:4217 /WX:4286. Unfortunately, clang-cl does not support this, so compromise and use /WX which treats all linker warnings as errors.

We were previously silently emitting incorrect code for the standard
libraries and the warnings were being swallowed by the build system.
This was brought to light by the new build system. The code generation
issues have been addressed. In order to prevent a backslide, we would
ideally use `/WX:4217 /WX:4286`. Unfortunately, `clang-cl` does not
support this, so compromise and use `/WX` which treats all linker
warnings as errors.
@compnerd
Copy link
Member Author

@swift-ci please smoke test

@etcwilde
Copy link
Member

LINK_WARNING_AS_ERROR/CMAKE_LINK_WARNING_AS_ERROR?
https://cmake.org/cmake/help/git-stage/prop_tgt/LINK_WARNING_AS_ERROR.html

@etcwilde
Copy link
Member

Added in version 4.0.

Nevermind... that's the future. Misread that as 3.4.

@compnerd compnerd merged commit 1f3fab0 into swiftlang:main Jan 27, 2025
3 checks passed
@compnerd compnerd deleted the this-is-your-last-warning branch January 27, 2025 16:45
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.

2 participants