php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79654 improper member use in zend_inheritance.c
Submitted: 2020-05-30 09:44 UTC Modified: 2020-06-09 07:33 UTC
From: g dot fischer at ah-consulting dot net Assigned:
Status: Open Package: Compile Failure
PHP Version: 7.4.6 OS: solaris 11
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2020-05-30 09:44 UTC] g dot fischer at ah-consulting dot net
Description:
------------
solaris 11.2, x86, sunpro 5.12.

"/mnt/x36/dev/php-7.4.6/Zend/zend_inheritance.c", line 2299: improper member use: child_fn
"/mnt/x36/dev/php-7.4.6/Zend/zend_inheritance.c", line 2301: improper member use: child_fn
"/mnt/x36/dev/php-7.4.6/Zend/zend_inheritance.c", line 2304: improper member use: parent_fn
"/mnt/x36/dev/php-7.4.6/Zend/zend_inheritance.c", line 2306: improper member use: parent_fn
"/mnt/x36/dev/php-7.4.6/Zend/zend_inheritance.c", line 2308: improper member use: always_error
"/mnt/x36/dev/php-7.4.6/Zend/zend_inheritance.c", line 2318: improper member use: child_prop
"/mnt/x36/dev/php-7.4.6/Zend/zend_inheritance.c", line 2319: improper member use: parent_prop
"/mnt/x36/dev/php-7.4.6/Zend/zend_inheritance.c", line 2338: improper member use: child_fn
"/mnt/x36/dev/php-7.4.6/Zend/zend_inheritance.c", line 2338: improper member use: parent_fn
"/mnt/x36/dev/php-7.4.6/Zend/zend_inheritance.c", line 2346: improper member use: child_fn
"/mnt/x36/dev/php-7.4.6/Zend/zend_inheritance.c", line 2346: improper member use: parent_fn
"/mnt/x36/dev/php-7.4.6/Zend/zend_inheritance.c", line 2347: improper member use: always_error
"/mnt/x36/dev/php-7.4.6/Zend/zend_inheritance.c", line 2353: improper member use: parent_prop
"/mnt/x36/dev/php-7.4.6/Zend/zend_inheritance.c", line 2353: improper member use: child_prop
"/mnt/x36/dev/php-7.4.6/Zend/zend_inheritance.c", line 2359: improper member use: child_prop
"/mnt/x36/dev/php-7.4.6/Zend/zend_inheritance.c", line 2359: improper member use: parent_prop
"/mnt/x36/dev/php-7.4.6/Zend/zend_inheritance.c", line 2416: improper member use: child_fn
"/mnt/x36/dev/php-7.4.6/Zend/zend_inheritance.c", line 2416: improper member use: parent_fn
"/mnt/x36/dev/php-7.4.6/Zend/zend_inheritance.c", line 2419: improper member use: child_fn
"/mnt/x36/dev/php-7.4.6/Zend/zend_inheritance.c", line 2419: improper member use: parent_fn
"/mnt/x36/dev/php-7.4.6/Zend/zend_inheritance.c", line 2420: improper member use: always_error
"/mnt/x36/dev/php-7.4.6/Zend/zend_inheritance.c", line 2422: improper member use: child_prop
"/mnt/x36/dev/php-7.4.6/Zend/zend_inheritance.c", line 2422: improper member use: parent_prop
cc: acomp failed for /mnt/x36/dev/php-7.4.6/Zend/zend_inheritance.c

happens with 7.4.7rc1 as well. 7.3.x and older are fine.



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-05-30 09:49 UTC] nikic@php.net
-Status: Open +Status: Feedback
 [2020-05-30 09:49 UTC] nikic@php.net
I have no idea what this error is supposed to mean. Does this compiler not support anonymous unions and structs or something?
 [2020-05-30 09:54 UTC] g dot fischer at ah-consulting dot net
it does support both.
 [2020-05-30 12:22 UTC] cmb@php.net
-Status: Feedback +Status: Open
 [2020-05-30 12:22 UTC] cmb@php.net
> sunpro 5.12

According to Wikipedia[1], sunpro 5.12 is part of Oracle Solaris
Studio 12.3, which has been released in December 2011.

[1] <https://en.wikipedia.org/wiki/Oracle_Developer_Studio#History>
 [2020-05-30 12:47 UTC] g dot fischer at ah-consulting dot net
correct but it doesn't matter because the same error comes up with later versions as well. it seems although anonymous structs and unions are supported, nesting them like zend_inheritance.c does is not.
so just to be sure it's a compiler specific issue i ran it through gcc and ...

/mnt/x36/dev/php-7.4.6/ext/standard/base64.c:855:1: internal compiler error: in simplify_binary_operation_1, at simplify-rtx.c:2966

oh my, that's a first. i don't remember having a program which managed to stop one and crash another compiler. 7.4 is definitely not for me.
 [2020-06-08 20:49 UTC] alexinbeijing at gmail dot com
Maintainers: Would you like a patch which converts the use of anonymous unions to ordinary, named unions, in the hopes of better compatibility with a wider range of C compilers?

It will certainly make the code a tiny bit more verbose.
 [2020-06-09 07:33 UTC] nikic@php.net
@alexinbeijing: Yes, that's fine. Certainly not the only compiler bug we work around.

It should be sufficient to make the nested structs named, not the union itself. We use anonymous unions in quite a few other places I believe.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed Nov 25 05:01:23 2020 UTC