Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:68302 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 83201 invoked from network); 24 Jul 2013 20:28:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Jul 2013 20:28:34 -0000 Authentication-Results: pb1.pair.com smtp.mail=ekneuss@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ekneuss@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.178 as permitted sender) X-PHP-List-Original-Sender: ekneuss@gmail.com X-Host-Fingerprint: 209.85.216.178 mail-qc0-f178.google.com Received: from [209.85.216.178] ([209.85.216.178:34046] helo=mail-qc0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F5/60-15053-0F830F15 for ; Wed, 24 Jul 2013 16:28:32 -0400 Received: by mail-qc0-f178.google.com with SMTP id b11so543756qcw.9 for ; Wed, 24 Jul 2013 13:28:29 -0700 (PDT) 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 :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=JfC0ZSXvNW30RhTfzHydhXKOWfSbtM+9nFeaPunFguk=; b=xRQNI8mDk9nsWtQpNEbMrMGoH+e57L2soGjum12jlU1kWnyw4/L8tmOGOWloDfgOfO kI0EKRPyzeUJBQbgcFTzUnABZQjdGTl+6DGeTkG+B5u+QIGk8HTeTwpodHuCdUJCoX0w 2VYUjyeQCm68dV4Wep1PImyME4vutCIj7G3qo1yx/Wp1FytgXi+IfaGf+6EX42aF2Qor 6gDVSkjZ37sUQdF0GUKd/HGJGAhn8NB8xS14x8HUndpP2N7+HQ3D1Pufh2VR45jccJXy TULKha/2AoeToqFscrOGwWSYVx5QjfPToVITBXH3RhorHXuHYsV+1B3J1QZElqc/sH6Y DdrQ== X-Received: by 10.49.13.40 with SMTP id e8mr371615qec.79.1374697709744; Wed, 24 Jul 2013 13:28:29 -0700 (PDT) MIME-Version: 1.0 Sender: ekneuss@gmail.com Received: by 10.49.95.228 with HTTP; Wed, 24 Jul 2013 13:28:09 -0700 (PDT) In-Reply-To: <51ECE9DA.8040705@sugarcrm.com> References: <51ECE9DA.8040705@sugarcrm.com> Date: Wed, 24 Jul 2013 22:28:09 +0200 X-Google-Sender-Auth: 9dpijQ1KDQmeFgOAZMKRbgmuvB4 Message-ID: To: Stas Malyshev Cc: PHP Internals Content-Type: multipart/alternative; boundary=047d7b673024a9b60d04e247c09b Subject: Re: [PHP-DEV] warning in php_spl.c From: colder@php.net (Etienne Kneuss) --047d7b673024a9b60d04e247c09b Content-Type: text/plain; charset=UTF-8 Hi Stas, On Mon, Jul 22, 2013 at 10:14 AM, Stas Malyshev wrote: > Hi! > > Building PHP 5.5 with newer compiler on Mac, I'm getting this warning: > > /Users/smalyshev/php-5.5/ext/spl/php_spl.c:803:35: warning: format > specifies type 'unsigned int' but the argument has type 'intptr_t' > (aka 'long') [-Wformat] > spprintf(&hex, 32, "%016x%016x", hash_handle, hash_handlers); > ~~~~~ ^~~~~~~~~~~ > %016lx > /Users/smalyshev/php-5.5/ext/spl/php_spl.c:803:48: warning: format > specifies type 'unsigned int' but the argument has type 'intptr_t' > (aka 'long') [-Wformat] > spprintf(&hex, 32, "%016x%016x", hash_handle, hash_handlers); > ~~~~~ ^~~~~~~~~~~~~ > %016lx > > Which suggests intptr_t there has wrong size. Looks like on 64-bit > intptr_t would be too long and hash_handlers may not have chance to be > in the hash. Anybody knows if there's a reason why this code is there? > The code is here to build the payload of what will be hashed to make what spl_object_hash() returns. I think it is safe to make it %016lx as suggested. Given the nature of this function it is BC safe, and may indeed result in less collisions. Best, Best, > > BTW, llvm compiler produces tons of warnings on PHP source, I'm planning > to get to them, probably next weekend. > -- > Stanislav Malyshev, Software Architect > SugarCRM: http://www.sugarcrm.com/ > (408)454-6900 ext. 227 > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Etienne Kneuss http://www.colder.ch --047d7b673024a9b60d04e247c09b--