-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Don't try to use C11 atomics, which are not const #11931
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
Open
ryandesign
wants to merge
1
commit into
php:PHP-8.2
Choose a base branch
from
ryandesign:ryandesign-zend-atomic
base: PHP-8.2
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 wouldn't be suitable for PHP 8.2. Can you share your compiler, compiler version, and target platform? We'll need to work out some detection for whether we need to cast the const away for PHP 8.2 (but for 8.3 we can probably apply this patch).
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've updated the linked issue with the compiler and OS information.
What makes you say this wouldn't be suitable for PHP 8.2? I have already applied this patch to MacPorts PHP 8.2 and 8.3 and have not received any reports of problems, though of course that doesn't guarantee there aren't any problems.
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 cannot just take away
HAVE_C11_ATOMICS
existing in a patch release.Uh oh!
There was an error while loading. Please reload this page.
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.
If your objection is about changing the name of the macro from
HAVE_C11_ATOMICS
toHAVE_C17_ATOMICS
, then a solution could be not to change the name.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 renamed it in order to have the macro name reflect the change in its definition. I did not consider that it might be part of public API that others would use. If it is public API, then another option might be to leave
HAVE_C11_ATOMICS
defined as it was and just not use it in PHP itself, addition to creatingHAVE_C17_ATOMICS
and using it as in this PR.Of course, I don't care how it's fixed, and I'm not very familiar with the code of the PHP project so I don't know what fix is best. All I care about is that it is fixed somehow.