Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:124716 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id EB8D01A00B7 for ; Fri, 2 Aug 2024 12:34:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1722602147; bh=tQWqo6kHo/stdIL4ppgH/u3VmdQQywYuX6GbY02p1W4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=BwWqaFLDqFc0GnmhFARqGoB4ocOJtJTd87Td8FWGmV5HMeKIkF5H8ltLraQMFrPH8 MCICv4MGfNMeZAixsbom4A0P4MxNjcLsSNW+OfEfbZp/w6Xf+HgiXYMf1dqr1TfOkH Y5yokygNjKjchaUP9vfdVL8eV2zsWFz4KUVX5zQMuVuX7z4skSWUO80G+MXPJy4zcE hIdULCfosvSEVHpvvvHw3szDB15F8Gx06GtfFYueMab1wwpSApDAhS+krtl6gk60qX oLt5UOWUGLAIZVwmFW1VVqOAwPRyM29LMIpIX7Hs1GGarJRnMwepxkShe/HZqV4vRJ bh5GwcMyUJJfg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id B713618005C for ; Fri, 2 Aug 2024 12:35:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,HTML_MESSAGE, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from venus.thgnet.it (venus.thgnet.it [159.69.22.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 2 Aug 2024 12:35:45 +0000 (UTC) Received: from mail-oi1-f181.google.com (mail-oi1-f181.google.com [209.85.167.181]) by venus.thgnet.it (Postfix) with ESMTPSA id 21F7F3E5D5 for ; Fri, 2 Aug 2024 14:34:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=giacobbi.net; s=venus; t=1722602045; bh=tQWqo6kHo/stdIL4ppgH/u3VmdQQywYuX6GbY02p1W4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=INTaXmBJ4gqVFblwUyAR/3mrmZwum/1C/rCeDY1A/GuFaO8f3swqxNhi2eA+CMwPT Y9+nAYnwohzhXjn0W2uDAXTymLkdZa4ANFGNtY6LvSxQmjnV2X+U5CFF7SQtKkkl3j EnhV18CNqXBt4z54MIh6rbaf0edKqzkzhAlaOHw8= Received: by mail-oi1-f181.google.com with SMTP id 5614622812f47-3db16129143so4626790b6e.0 for ; Fri, 02 Aug 2024 05:34:05 -0700 (PDT) X-Gm-Message-State: AOJu0YwMMRVuPHyy3B7JuqZT1LLHIMGt4SQWKfjbrn14QzHfjAO8BjgS 0+hpjA0cfODNomFAVFShSoaljh9Rbpk7ELLc+D/Xh8Kyd/IvMaeGYaGlzOrN/7crQvRJJPtFAG4 PsAWvKr8dJ7HopYJKuenKvRVp2J8= X-Google-Smtp-Source: AGHT+IHhhxKnlXmecsoxQbN8Ws3sTcmX8SE2jhKAhVBJrbfQOjoNeHClgO/rkWPAyqVtnt6yefKEOQHOWxyvZAXSvsY= X-Received: by 2002:a05:6870:c182:b0:254:7a82:cb3f with SMTP id 586e51a60fabf-26891d4b1bbmr4184383fac.25.1722602043998; Fri, 02 Aug 2024 05:34:03 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 References: In-Reply-To: Date: Fri, 2 Aug 2024 14:33:53 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PHP-DEV] Require C11 in PHP 8.4 To: Ilija Tovilo Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000ec1510061eb28a40" From: giovanni@giacobbi.net (Giovanni Giacobbi) --000000000000ec1510061eb28a40 Content-Type: text/plain; charset="UTF-8" On Thu, 1 Aug 2024 at 23:57, Ilija Tovilo 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. --000000000000ec1510061eb28a40 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Thu, 1 Aug 2024 at 23:57, Ilija Tovilo= <tovilo.ilija@gmail.com&g= t; wrote:
[...]
I started fixing these in a PR [1] which requ= ired 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 wron= g 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=C2=A0differ= ent approach, just as a proof of concept. The idea is to move all the globa= l 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 file= s 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 t= he design right.

--000000000000ec1510061eb28a40--