warning in php_spl.c

From: Date: Mon, 22 Jul 2013 08:14:18 +0000
Subject: warning in php_spl.c
Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
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?

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


Thread (2 messages)

« previous php.internals (#68277) next »