Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101369 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 84696 invoked from network); 18 Dec 2017 21:31:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Dec 2017 21:31:28 -0000 Authentication-Results: pb1.pair.com header.from=php@golemon.com; sender-id=softfail Authentication-Results: pb1.pair.com smtp.mail=php@golemon.com; spf=softfail; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain golemon.com does not designate 209.85.216.194 as permitted sender) X-PHP-List-Original-Sender: php@golemon.com X-Host-Fingerprint: 209.85.216.194 mail-qt0-f194.google.com Received: from [209.85.216.194] ([209.85.216.194:34728] helo=mail-qt0-f194.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A1/B9-21958-FA3383A5 for ; Mon, 18 Dec 2017 16:31:28 -0500 Received: by mail-qt0-f194.google.com with SMTP id 33so21873864qtv.1 for ; Mon, 18 Dec 2017 13:31:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=golemon-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=jgwvgzH2vNxEg7qA7jilEFfeXBPVZQbL97r8VHFzalU=; b=G1cI+OV3ziDgX/Q5pgvSp77C/G0yhwWf309eY+zsxfkTxkDXXGMxNDX8/to8D2biR5 jiCaUv9BRFTOHQ4h1VR4GXZs4xJ/6CQ8UBfMNIOQhhFMJYLp5Uq3yOoP6g4AU2LSSLzy YtiixCobhhbSKlTqtZFjV5kch5KybbUizLuAd3dWQlK+pboguVSkMoaK3AAItWgENu0P OH1QTyraweRU7XjJu69l3WaixrbTQkazjaGLFM9JmOlqcoewR5CuLyvs3aT49HeabE2j MA/N0AH9AoyQpuR/062Crt1WLiE27IYdMy/Z8ga9qN+06w6sprtriV59aFxibMCnnTAH LTAQ== 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=jgwvgzH2vNxEg7qA7jilEFfeXBPVZQbL97r8VHFzalU=; b=c4+8UwPq9KXSXQT46l1dcznFKjwzZwOgHoBJWMwOaZMzgbgcWWw2YL3xx2OQqBx47H a0bkttSh9coY2RLNIRkv59kMByJPRbdMN6OMYTU8OX7W/VkNsXIzwbkW1FcjvQK0gp0Z lfSgZ8I2w248GTpslKb48mbN3B2HcsUd+hTmP53Jaqxpek32BKGylsCU3r9jC+SLXCxh RK0/DZr4mTC1CcHPmhlrsBbGQOXUlLGyl55PZPBxccZTPuXfq/yApvsMQpkgW8xp6EXu cfFCIVPEKJvbTPSmHSc+X+MD0geQcpG8RJFp+vH7CS0FNbtNi5tWa3NNLwAl+dqmWboD yKyg== X-Gm-Message-State: AKGB3mK0vxu0RjpjnDKOMfDYiylUTk0r7avJnb6n3Q3Wi2/WSRWlz2yP 9x/jFf/yWJ4jylC4tA7Oqz5U/F29X+r9P4i/pg7Jlg== X-Google-Smtp-Source: ACJfBov1JhWK1tlgVncSpQhYfRePlZjmD0f1L+dFcqOycM6/abO4Ut3/9ph0RKIMQ4zVIUAg98r8xcdPlIoNXg3cOQM= X-Received: by 10.237.58.167 with SMTP id o36mr1816026qte.333.1513632685234; Mon, 18 Dec 2017 13:31:25 -0800 (PST) MIME-Version: 1.0 Sender: php@golemon.com Received: by 10.12.158.145 with HTTP; Mon, 18 Dec 2017 13:31:24 -0800 (PST) X-Originating-IP: [206.252.215.26] In-Reply-To: References: Date: Mon, 18 Dec 2017 16:31:24 -0500 X-Google-Sender-Auth: _wDFzz1N59lEoenClGMTPJ6imag Message-ID: To: Levi Morrison Cc: PHP internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] C++ and FAST_ZPP macros From: pollita@php.net (Sara Golemon) 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