Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80967 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 88943 invoked from network); 22 Jan 2015 10:14:06 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Jan 2015 10:14:06 -0000 Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.44 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.192.44 mail-qg0-f44.google.com Received: from [209.85.192.44] ([209.85.192.44:60829] helo=mail-qg0-f44.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 41/F4-61273-D6DC0C45 for ; Thu, 22 Jan 2015 05:14:06 -0500 Received: by mail-qg0-f44.google.com with SMTP id l89so444079qgf.3 for ; Thu, 22 Jan 2015 02:14:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=13Yz6/kYUhortD+tnVy3y1ZOUPvPWqNbycDi0QO8nL8=; b=DPgJ1Rq5taxvHH0Y6UAnNpvPICOS4QbrO+cOUwbyIhqDRZaXTmT/OWyY+ylgfwvp3J 7WhJhMUfT62lWXM0/H5FKy48Ul7Um2ED25q97Z6JYcM/epqowQhY+eHOd2iByH71qMtY WXA0z6ZW6sGa3E57suN/qiidYhDbUERwNbkUtHn/T91kcSCdbtpmDCAL0sP9lYs5m/eh v2CqRoHEkK7P47iU/EOfMzObmiNg9GpHHY21W0YKTUq8W+GOE6Qkderr8KXT8NHqQCZt TMmsg4Jg/aXm3o+HIXWjzQfHq4EjSflnebX6em/oGRrrgurAWOzaDGtbXO/yLhOTiUtJ UNKQ== X-Received: by 10.140.20.226 with SMTP id 89mr854859qgj.43.1421921643074; Thu, 22 Jan 2015 02:14:03 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.229.93.70 with HTTP; Thu, 22 Jan 2015 02:13:22 -0800 (PST) In-Reply-To: <54BEE31B.3020403@lerdorf.com> References: <54BECE9E.5050502@lerdorf.com> <54BED307.5010606@lerdorf.com> <54BEDABB.2040406@gmail.com> <54BEE31B.3020403@lerdorf.com> Date: Thu, 22 Jan 2015 19:13:22 +0900 X-Google-Sender-Auth: I8iThX_5rFwD0X0ent4z6dsIJdc Message-ID: To: Rasmus Lerdorf Cc: Stanislav Malyshev , PHP internals Content-Type: multipart/alternative; boundary=001a11c1257e6f2584050d3aee56 Subject: Re: [PHP-DEV] Re: Help - gcc mystery in ext/imap From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a11c1257e6f2584050d3aee56 Content-Type: text/plain; charset=UTF-8 Hi all, On Wed, Jan 21, 2015 at 8:22 AM, Rasmus Lerdorf wrote: > On 01/20/2015 02:46 PM, Stanislav Malyshev wrote: > > Hi! > > > >> So, I guess the lesson is that we need to be careful when we migrate > >> extensions to PHP 7. Passing ints instead of size_t string length params > >> to zpp can cause extreme weirdness and we should go through all our > >> bundled extensions and make sure things that are still using "s" have > >> all been changed to size_t. > > > > Definitely so. I've recently went through intl and fixed a bunch of > > int/size_t issues, but judging from how many there were, I assume other > > non-trivial extensions would have such things too. We have lots of > > places where size_t and int are intermixed - e.g., random try, go to > > mysqli extension, do grep int *.c | grep len and see that results of > > spprintf - which returns size_t - are put into int. Now, in this case > > it's almost 100% not a problem, but illustrates bigger issue of mixing > > the types, and in some cases it may be a real problem. > > Yeah, I was quite surprised by the weirdness it caused. I don't think I > have ever seen something that breaks under -O2 start working again > compiled with -O3. That's what had me chasing my tail into assembly > world for a bit there. > > I have fixed up ext/imap now. Hopefully I caught them all. I'm observing somewhat similar behavior. I don't have clue why it does... gcc version 4.9.2 20141101 (Red Hat 4.9.2-1) (GCC) Should we use size_t/ptrdiff_t everywhere applicable? Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --001a11c1257e6f2584050d3aee56--