-
Notifications
You must be signed in to change notification settings - Fork 7.9k
8.4.0alpha2 fails to build: error: redefinition of typedef ‘zend_string’
#15070
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
Comments
Hmmmm, @barracuda156 can you please try with commit 6335264 reverted? |
I think it is not that (though I had to revert that manually, but I hope I did not miss anything):
|
It's not only redefinitions, but also warnings about initializers I see. |
4.2 is the last GCC Apple shipped back then, but I’m pretty sure most ports systems on Mac provide a newer gcc. |
@nielsdos @NattyNarwhal If it is not buildable anymore with Xcode gcc, we can use a newer one, I believe. @ryandesign Ryan, should we just switch the port away from using archaic compilers? |
There is no urgency for me in resolving issues with ancient systems. I will wait to see what other suggestions are made here. |
Sure, it is not urgent. |
So is it possible for you to use a more modern compiler at least to test whether this solves the reported issue? |
@cmb69 With gcc 13.3.0 no errors, though
|
Build completed with no issues:
|
Thanks for checking this (the warnings should probably addressed anyway). However, I've just checked a single redefinition reported by the old GCC:
And this looks like a valid complaint from a C(99) compiler, see https://stackoverflow.com/questions/8594954/repeated-typedefs-invalid-in-c-but-valid-in-c#8595131. It might be better to fix this. @iluuu1994, since you wrote zend_property_hooks.h, what do you think? |
I can remove the |
Redefinition of types is only allowed in C11 and later. |
We have since bumped our compiler requirement to C11. See https://www.php.net/manual/en/install.unix.source.php:
Thus, we can consider this solved. Thank you for the report! |
Does the C version requirement apply only to the source code of the PHP project or also to all third-party PHP modules built against such a PHP version? |
As far as I know, the only C11 feature we use is support for redefinition of typedefs. That is likely also required when building extensions. That should only be relevant with ancient compilers (such as GCC 4.2), though. |
Description
Build fails due to type redefinition:
PHP Version
PHP 8.4.0alpha2
Operating System
macOS 10.6
The text was updated successfully, but these errors were encountered: