Skip to content

stdlib: remove usage of GNU extensions in the Darwin os module #27939

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
Nov 5, 2019

Conversation

compnerd
Copy link
Member

Remove the gratuitous use of the GNU extensions to implement the OS logging
module. This allows us to enable -Werror=gnu globally, even on macOS builds.

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

Resolves SR-NNNN.

@compnerd
Copy link
Member Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 2f6e798c214faced83ca1f6f5c8707532a18c3f3

@compnerd
Copy link
Member Author

@swift-ci please test macOS platform

Copy link
Contributor

@jrose-apple jrose-apple left a comment

Choose a reason for hiding this comment

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

I'm not sure but this code might come straight from Apple sources, in which case it'd be more important to keep it in sync with that. @lorentey, can you talk to whoever's responsible for the classic os overlay?

@@ -33,7 +33,7 @@
const void *olp_mh;
const void *olp_pc;
const char *olp_format;
uint8_t olp_data[0];
uint8_t *olp_data;
Copy link
Contributor

Choose a reason for hiding this comment

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

This isn't the same; it's a trailing array member.

Copy link
Member Author

@compnerd compnerd Oct 30, 2019

Choose a reason for hiding this comment

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

ah, crud; right, the trailing array member is 0-sized, as opposed to the pointer which is pointer sized. Hmm, I wonder if there is another trick for this.

Copy link
Member Author

Choose a reason for hiding this comment

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

We use C99, so I can replace it with a FAM. Going to at least prepare the patch, so that once @lorentey has spoken with the responsible party, we can figure out the best way forward here.

Remove the gratuitous use of the GNU extensions to implement the OS logging
module.  This allows us to enable `-Werror=gnu` globally, even on macOS builds.
@compnerd
Copy link
Member Author

@swift-ci please smoke test

@compnerd
Copy link
Member Author

@swift-ci please smoke test macOS platform

@compnerd
Copy link
Member Author

@lorentey - so, whats the conclusion on this change?

@lorentey
Copy link
Member

lorentey commented Nov 5, 2019

@compnerd Sorry for the delay -- there are no objections, we're happy to land this.

@lorentey lorentey merged commit 4008261 into swiftlang:master Nov 5, 2019
@compnerd compnerd deleted the gnu-no-more branch February 15, 2020 19:37
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.

4 participants