Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101370 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 87969 invoked from network); 18 Dec 2017 22:47:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Dec 2017 22:47:46 -0000 Authentication-Results: pb1.pair.com smtp.mail=morrison.levi@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=morrison.levi@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.68 as permitted sender) X-PHP-List-Original-Sender: morrison.levi@gmail.com X-Host-Fingerprint: 74.125.82.68 mail-wm0-f68.google.com Received: from [74.125.82.68] ([74.125.82.68:40934] helo=mail-wm0-f68.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4F/0A-21958-095483A5 for ; Mon, 18 Dec 2017 17:47:45 -0500 Received: by mail-wm0-f68.google.com with SMTP id f206so611743wmf.5 for ; Mon, 18 Dec 2017 14:47:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=i634LE006nFC/iEIgjhv6hKctuDIAD3nu3+3TPPpKmM=; b=hKOsbRxDuTMhZ4qeLx+bpUZcPAMN+bBRh0N0V3w0CMwdYEq6XD9ycsdH1qasmK3iUm YaVdr4FgcuhepsWIsDtIS4c43KMLSplcdh2CnpDAQRkEQag1XyTXhBUMxNfYma8PFVhc 5IR9IgLmf2Gsl2UEKQJlCVWPI9tjPVoGRgf+UMF0USeJXcaeLGUgG0ju1vFziemZ7fOe xwUSY2hrmM2jxKj0FpBLQ2LAXA/TODH+dcHLwhuyAU7HUNbnMGQ43EyqArAS6Tc/eSki c4eYeh7J5KbVCeMy5rqI/Mqk3ZUR1J7dI2sGXZZmYayYM/gMR3XM0YDsJ7bmLZgvGRSV FgPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=i634LE006nFC/iEIgjhv6hKctuDIAD3nu3+3TPPpKmM=; b=PLFRS6SEZgHfVljsrmdQhi2JabOdPHYZRWSW+XfQDoJkK0wbA/uT/tFEUFUGdZKsLB 1asBazH8VysIcmPMfecvIYqC4KCi1gEIGVjN00JOGjMbyzADKAlooxzBiIp2MKNcvwju GB7UM9WPEMz/T7BAXXI/jIXIRoGmCttBpPzad168AScSaBess7Ej3kMkQlVZgMirSHWR iOOgNlWq00G7nDXNU0Khp3HR5Mpqjr87+0MWxElo9ST8s5rC05AqrNvYHyzeVh0T/CAJ Ycl3s6dsenMEyKhMRm3XIw9pt+p9cfdAyRyGp+BJaBqSm0PkdZEmRp9XBmxfUhnkyPq9 Eq6g== X-Gm-Message-State: AKGB3mLdIVetmr9OOaNt6kEVBovNXMcIjtam2cv+Me5GA5T8eeBVsKbC m8DqyRe9mh8CVaBzHxZtm/1PmHIr5m0JiX/fIjecbw== X-Google-Smtp-Source: ACJfBosOhXY3RiftNO3VQ9764Sb+2zrdvkaQmCnaicg2BeqTW6LRXpMYF66i4sGS5k/FsUwF6PtaWvDxFD1KZ6XoPNs= X-Received: by 10.28.229.213 with SMTP id c204mr948813wmh.57.1513637261163; Mon, 18 Dec 2017 14:47:41 -0800 (PST) MIME-Version: 1.0 Sender: morrison.levi@gmail.com Received: by 10.28.21.68 with HTTP; Mon, 18 Dec 2017 14:47:40 -0800 (PST) In-Reply-To: References: Date: Mon, 18 Dec 2017 15:47:40 -0700 X-Google-Sender-Auth: M-gdUvIkFAEOYKJIs37uLWVE9HM Message-ID: To: Sara Golemon Cc: PHP internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] C++ and FAST_ZPP macros From: levim@php.net (Levi Morrison) On Mon, Dec 18, 2017 at 2:31 PM, Sara Golemon wrote: > On Mon, Dec 18, 2017 at 4:11 PM, Sara Golemon wrote: >> On Mon, Dec 18, 2017 at 3:38 PM, Levi Morrison wrote: >>>> Thoughts? If I don't hear anything in a week, I'll just apply to 7.1 >>>> and merge up. >>>> >>> Is our macro `#define Z_EXPECTED_TYPE_STR(id, str) str,` ever used? If >>> so there might be a change in perceived behavior because the first >>> entry previously had "integer" and now it is "mixed". >>> >> It exists for the purpose of generating output message when the type >> is not cast/coercible to the expected type. The index of the string >> entry corresponds 1:1 with the value of the enum, so it'll only show >> "mixed" when the expect type was ANY and we failed to cast/coerce to >> ANY (which will obviously never happen). >> >> In fact, the previous state where _expected_type was initialized to >> IS_UNDEF (and by extension interpreted poorly as Z_EXPECTED_LONG) >> would also never happen because the cast/coersion error is only >> produced by P_PARAM_*() macros who have in turn explicitly reset >> _expected_type to some specific value. >> >> The default initialization exists only to silence unhelpful compiler >> warnings and not to provide any actual use or effect. >> > To clarify one last thing: Simply changing the IS_UNDEF on that > initialization line to Z_EXPECTED_LONG would have also worked here > because as stated above, it's never *actually* used without being > reset to a meaningful case. I went with a new enum value to make the > intent more clear to someone reading this in the future. > > If it makes anyone more comfortable, I can make the 7.1/7.2 fix be > that simple, and add the new enum value in master, or even just forgo > the new enum value in favor of an inline comment explaining why the > default value in Z_EXPECTED_LONG. > > -Sara I am fine with the change; I just wanted to double-check that aspect.