Skip to content
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

crnlib: do not call sem_destroy on macOS #55

Merged
merged 1 commit into from
Jul 5, 2024
Merged

Conversation

illwieckz
Copy link
Member

@illwieckz illwieckz commented Jul 4, 2024

On macOS, sem_unlink should be used instead of sem_destroy, what the current code does is to call sem_destroy on every pthread-compatible system and then call sem_unlink on macOS.

It is expected the only macOS implementation of it and other functions like sem_init is to do nothing but to exist and be marked as deprecated so the compiler can print warnings as the -Wdeprecated-declarations flag is enabled by default.

Because sem_destroy is expected to be a stub on macOS and we call sem_unlink anyway, the current code works but raises a “'sem_destroy' is deprecated” warning at build time for something we don't need and we already have the right implementation done anyway.

On macOS, sem_unlink should be used instead of sem_destroy,
what the current code does is to call sem_destroy on every
pthread-compatible system and then call sem_unlink on macOS.

It is expected the only macOS implementation of it and other
functions like sem_init is to do nothing but to exist and
be marked as deprecated so the compiler can print warnings
as the -Wdeprecated-declarations flag is enabled by default.

Because sem_destroy is expected to be a stub on macOS and
we call sem_unlink anyway, the current code works but raises
a “'sem_destroy' is deprecated” warning at build time for
something we don't need and we already have the right
implementation done anyway.
@illwieckz illwieckz added the enhancement New feature or request label Jul 4, 2024
@illwieckz illwieckz merged commit 621d48b into master Jul 5, 2024
2 of 3 checks passed
@illwieckz illwieckz deleted the illwieckz/macos-sem branch July 5, 2024 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants