Skip to content

build: try to ban GNU extensions #27774

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 18, 2019
Merged

Conversation

compnerd
Copy link
Member

GNU extensions are inherently non-portable, and can cause regressions on
other platforms. Attempt to catch the accidental use of GNU extensions
early by using clang to identify them.

Replace this paragraph with a description of your changes and rationale. Provide links to external references/discussions if appropriate.

Resolves SR-NNNN.

GNU extensions are inherently non-portable, and can cause regressions on
other platforms.  Attempt to catch the accidental use of GNU extensions
early by using clang to identify them.
@compnerd
Copy link
Member Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 06dd33c

@DougGregor
Copy link
Member

Good idea. Does LLVM already do this? Or are we trying to stage it in here first, then do it upstream in LLVM?

@compnerd
Copy link
Member Author

I don't think that LLVM adds this particular flag. I can certainly bring this up for LLVM, but, its less likely to be an issue since the CI there will email you if the change breaks on MSVC.

@CodaFi
Copy link
Contributor

CodaFi commented Oct 18, 2019

Hmph, good that we know it works...

@compnerd
Copy link
Member Author

sigh who let me near a computer? of course this is going to fail! I just fixed the instance of the GNU extension!

@compnerd
Copy link
Member Author

@swift-ci please test

@jrose-apple
Copy link
Contributor

A little worried about us being more strict than LLVM because of headers, but okay.

@compnerd
Copy link
Member Author

@jrose-apple - yeah, I figure that if we can get Swift to build with -Werror=gnu I can try to add that to LLVM upstream (and then pull that back down).

@compnerd compnerd merged commit 33e5c0d into swiftlang:master Oct 18, 2019
@compnerd compnerd deleted the herd-the-gnus branch October 18, 2019 19:59
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