Hi all, On Wed, Jan 21, 2015 at 8:22 AM, Rasmus Lerdorf <ras...@lerdorf.com> 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 yohg...@ohgaki.net