Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:71426 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 10209 invoked from network); 23 Jan 2014 09:13:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Jan 2014 09:13:18 -0000 Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.46 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 74.125.82.46 mail-wg0-f46.google.com Received: from [74.125.82.46] ([74.125.82.46:58010] helo=mail-wg0-f46.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 85/50-08036-C2DD0E25 for ; Thu, 23 Jan 2014 04:13:17 -0500 Received: by mail-wg0-f46.google.com with SMTP id x12so1184250wgg.1 for ; Thu, 23 Jan 2014 01:13:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Q+T9ZNFGbdOvfIXbV8RU5UWWhiUB6b7gbzLIBfsMHOA=; b=zH1L9zbyBz7i3lhkRqSLvyW3yAL35SdiFUC4Tovex0qHVMStBxHf8h4PlHTBJL6CHO 2Befc8/Bm80TSxBgP97WBB5EvVoQBYVK0nx5gLw20N/m5xAH1gl7gFNkmBYk68QCJbX5 Z39n9K9zx4YGcaIln5w47oLdWkYatmTUgx3Hx7eUWQnhpz9g6LfV+xMsgF2jP59eUjF+ IpmRbY8ldsol9G1Qt5oPkcyHAivHzyAob6tEbi0PYyy4vyxQXptHWK2hRE214F111a+/ 47owr1s/dhm+OTz89ZveC+Cnyec8DUgQbuuP+MEJ6JuDzCLz5NtUVTJdL3Lf39QAlZqy u6/w== MIME-Version: 1.0 X-Received: by 10.194.81.196 with SMTP id c4mr1398725wjy.57.1390468393906; Thu, 23 Jan 2014 01:13:13 -0800 (PST) Received: by 10.227.224.142 with HTTP; Thu, 23 Jan 2014 01:13:13 -0800 (PST) In-Reply-To: References: Date: Thu, 23 Jan 2014 10:13:13 +0100 Message-ID: To: Dmitry Stogov Cc: Nikita Popov , Anatol Belski , PHP Developers Mailing List Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [RFC] 64 bit platform improvements for string length and integer From: pierre.php@gmail.com (Pierre Joye) On Thu, Jan 23, 2014 at 9:42 AM, Dmitry Stogov wrote: > I completely agree with Nikita. > Why to rename LONG->INT STRLEN->STRSIZE in thousands places? > Why not just define zend_long and zend_ulong to be 64-bit on 64-bit > platforms and use them instead of int, ulint, zend_int, zend_uint, long, > ulong where it's necessary. > > Anatol, I understood your point about catching incompatibility code at > compile-time, but I'm not sure if the new features cost such huge code base > changes. To catch 64bit issues at compile is immensely valuable. We had so many issues in the past, some of them leading to security issues. It is also a one time job, with a little extra effort for two years. Besides the portability improvements, code review and correctness is one of the goal of this RFC. I can't remember to know any widely known and sane project relying on on other type for buffer length. PHP does not have to be different :) > 1) 64-bit integers on Windows (they are already 64-bit on other systems) Almost all :) > 2) 64-bit string length. I don't think many people are interested in that. > Fortunately, the patch doesn't change the zval size, so it shouldn't make a > lot of harm. However, usage of "zend_size_t" instead of "int" is a bit > annoying. I would change it into the same "zend_long" or "zend_ulong". It is not about being interested but preventing many security issues as well, by default. The large buffer availability is a good side effect. The implementation correctness is also drastically improved in this case. Cheers, -- Pierre @pierrejoye | http://www.libgd.org