-
Notifications
You must be signed in to change notification settings - Fork 7.7k
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
error: unknown field ‘arData’ specified in initializer #11063
Comments
Hi @Jan1205. Can you specify what compiler you're using? Have you tried a full rebuild? ( |
That was my frist try. The error still appears. Unfortunately it is a very old system and version: gcc 4.1.2 |
That is indeed a very old version. Is there a particular reason why you can't upgrade? Would it be possible to try with a new version to confirm this is actually the issue? What |
@iluuu1994 Thanks for your reply. The migration is already being planned. So in the next time we will use a newer version. It works with perfectly with version 8.3. or newer. It would be great if there is a solution for the older version. My configure:
The issue only effects on PHP 8.2. Thank you very much for your support. |
This line produces the error:
When i remove "-std=gnu99" it works. Is there any configure options? |
I think Can you remove it locally to confirm it works without it? I'm really not proficient enough with the build system to know if backporting is a good idea. @Girgias maybe? Edit: It looks like the macro is still added for autoconf <2.70 so backporting this should be safe. |
When I remove |
Hmm, then I don't know 😞 |
Looks like an old GCC shortcoming with anonymous unions in structs: https://godbolt.org/z/v5frzzo8v (last version of GCC on Godbolt that breaks is 4.5.3, first working version is 4.6.4). |
I have encountered the same error when trying to compile with: I was able to compile PHP successfully. Edit Zend/zend_hash.c:
replace with
|
Accidentally introduced in 175ff60. arData was not part of an anonymous union.
Notice: the fix have been reverted, see 8f66b67 GCC 4.1.2 may be from EL-5... For memory
IMHO, it makes sense to stop supporting such old things and encouraging people to use dead cows. |
Only reverted for 8.1 afaict, because only 8.2+ needed the fix. |
Yes, @nielsdos is right. I merged this for 8.1, not realizing the array structure was different then. I agree we shouldn't make large changes to support old versions. This change was small and seemed harmless. |
Description
Since PHP 8.2 with old compilers we have the following error:
/usr/local/src/php-8.2.4/Zend/zend.c: In function ‘zend_vspprintf’:
/usr/local/src/php-8.2.4/Zend/zend.c:211:2: warning: missing initializer
/usr/local/src/php-8.2.4/Zend/zend.c:211:2: warning: (near initialization for ‘buf.len’)
/usr/local/src/php-8.2.4/Zend/zend.c: In function ‘zend_vstrpprintf’:
/usr/local/src/php-8.2.4/Zend/zend.c:263:2: warning: missing initializer
/usr/local/src/php-8.2.4/Zend/zend.c:263:2: warning: (near initialization for ‘buf.a’)
/usr/local/src/php-8.2.4/Zend/zend.c: In function ‘zend_print_flat_zval_r’:
/usr/local/src/php-8.2.4/Zend/zend.c:462:2: warning: missing initializer
/usr/local/src/php-8.2.4/Zend/zend.c:462:2: warning: (near initialization for ‘buf.a’)
/usr/local/src/php-8.2.4/Zend/zend.c: In function ‘zend_print_zval_r_to_str’:
/usr/local/src/php-8.2.4/Zend/zend.c:542:2: warning: missing initializer
/usr/local/src/php-8.2.4/Zend/zend.c:542:2: warning: (near initialization for ‘buf.a’)
/usr/local/src/php-8.2.4/Zend/zend.c: In function ‘zend_error_zstr_at’:
/usr/local/src/php-8.2.4/Zend/zend.c:1321:20: warning: ‘saved_class_entry’ may be used uninitialized in this function
/usr/local/src/php-8.2.4/Zend/zend_hash.c:240:2: warning: missing initializer
/usr/local/src/php-8.2.4/Zend/zend_hash.c:240:2: warning: (near initialization for ‘zend_empty_array.gc.u’)
/usr/local/src/php-8.2.4/Zend/zend_hash.c:243:2: error: unknown field ‘arData’ specified in initializer
/usr/local/src/php-8.2.4/Zend/zend_hash.c:243:2: warning: missing braces around initializer
/usr/local/src/php-8.2.4/Zend/zend_hash.c:243:2: warning: (near initialization for ‘zend_empty_array.’)
/usr/local/src/php-8.2.4/Zend/zend_hash.c:243:2: warning: initialization from incompatible pointer type
Is there a chance to fix this?
PHP Version
PHP 8.2.4
Operating System
No response
The text was updated successfully, but these errors were encountered: