Skip to content

[Stdlib] Enable -Wformat-nonliteral and make it an error. #39901

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
Oct 25, 2021

Conversation

al45tair
Copy link
Contributor

Turn on -Wformat-nonliteral so that any format string that is passed through a variable is turned into an error. There are a variety of reasonable ways of fixing these where they occur, and it's safer to have this switched on.

This should only be merged after #39900.

rdar://84571859

@al45tair
Copy link
Contributor Author

@swift-ci Please smoke test

@al45tair al45tair requested a review from mikeash October 25, 2021 13:06
Copy link
Member

@compnerd compnerd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this!

Turn on -Wformat-nonliteral so that any format string that is passed through
a variable is turned into an error.  There are a variety of reasonable ways
of fixing these where they occur, and it's safer to have this switched on.

rdar://84571859
@al45tair
Copy link
Contributor Author

@swift-ci Please smoke test

@al45tair
Copy link
Contributor Author

(I just rebased it to make sure that we only end up with the enabling change in this PR, in case we need to revert.)

@al45tair al45tair merged commit 48a23a8 into swiftlang:main Oct 25, 2021
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