-
Notifications
You must be signed in to change notification settings - Fork 10.5k
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
Conversation
@swift-ci please test |
Build failed |
@swift-ci please test macOS platform |
There was a problem hiding this 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?
stdlib/public/Darwin/os/os.m
Outdated
@@ -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; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
@swift-ci please smoke test |
@swift-ci please smoke test macOS platform |
@lorentey - so, whats the conclusion on this change? |
@compnerd Sorry for the delay -- there are no objections, we're happy to land this. |
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.