Re: Require C11 in PHP 8.4
| From: | Giovanni Giacobbi | Date: | Fri, 02 Aug 2024 12:33:53 +0000 |
| Subject: | Re: Require C11 in PHP 8.4 | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-124716@lists.php.net to get a copy of this message | ||
On Thu, 1 Aug 2024 at 23:57, Ilija Tovilo <tovilo.ilija@gmail.com> wrote:
> [...]
> I started fixing these in a PR [1] which required more changes than
> expected. After a short discourse, we were wondering whether it might
> be better to switch to a newer C standard instead. Our coding
> standards [2] currently specify that compiling php-src requires C99.
> The Unix installation page on php.net [3] claims it is ANSI C, which
> is certainly outdated. There have been suggestions to require C11 for
> a while, which should be well supported by all compilers shipped with
> maintained distributions.
>
It feels wrong to raise such an important requirement that might affect a
lot of people, including maintainers of extensions, for just one specific
problem, and 99% of the codebase would still be C99 compliant.
I quickly put together an alternative PR (#15202) with a slightly different
approach, just as a proof of concept. The idea is to move all the global
typedefs in a new include header "zend_types_defs.h" (but also
zend_portability.h can be reused for this purpose, as all the relevant
files already include it).
While putting together that PR, I had the feeling that this typedef
redefinition problem is in reality hiding some smelly design of header
files. So maybe, rather than requiring a compiler more tolerant to poor
code, we should rather focus on getting the design right.