-
Notifications
You must be signed in to change notification settings - Fork 8k
Fix ZEND_STATIC_ASSERT for -std=c++17 #19175
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
Closed
Closed
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
Oops, something went wrong.
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.
@psumbera @devnexen
static_assert()was added in C++11 so this change breaks compilation with-std=c++98(e.g. swig/swig#3255). If you're going to usestatic_assert()with C++, it should only be for C++11 and 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.
we did not put guards because php supports now C++11/17 minimum.
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.
honestly, if you have the choice, please drop C++98, std::move avoiding better dangling pointers is really worth the jump and that s not the only benefit ;)
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.
Is that also a requirement when building a third party extension module written in C++? That's the situation where we hit this (rather than when building PHP itself as in the linked issue).
If so, where is this requirement documented?
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.
not documented per say but PHP had updated the C++ build here.
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.
Sadly I don't really have the choice (though personally I tend to agree). SWIG is a tool to generate bindings for various langauges, including PHP, and those bindings are very widely used so we're pretty conservative on raising such requirements.
I can argue for raising it specifically for SWIG/PHP if PHP itself rejects compiling with older C++ versions, though it'd be easier to argue if this requirement were documented properly, and also useful to know how evolves with each PHP version. I'd think documenting this would also be helpful for other users.
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.
yes good point about documenting