php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50266 conflicting types for llabs
Submitted: 2009-11-23 02:55 UTC Modified: 2010-02-22 15:36 UTC
From: selsky at columbia dot edu Assigned:
Status: Closed Package: Date/time related
PHP Version: 5.2SVN-2009-11-23 (snap) OS: Solaris 9
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: selsky at columbia dot edu
New email:
PHP Version: OS:

 

 [2009-11-23 02:55 UTC] selsky at columbia dot edu
Description:
------------
llabs() is defined in both /usr/include/stdlib.h and ext/date/php_date.c

#if defined(__GNUC__) && __GNUC__ < 3
static __inline __int64_t llabs( __int64_t i ) { return i >= 0 ? i : -i; 
}
#endif

I'm using gcc 2 so this inline function is defined, but it's also 
defined by the system.  Perhaps it would be better to test for the 
function in configure and set something in php_config.h?

Reproduce code:
---------------
$ uname -a
SunOS cumin 5.9 Generic_122300-45 sun4u sparc SUNW,UltraAX-i2 Solaris
$ gcc --version
2.95.3
$ ./configure
$ make
/bin/sh /tmp/php5.2-200911230130/libtool --silent --preserve-dup-deps --mode=compile gcc -Iext/date/lib -Iext/date/ -I/tmp/php5.2-200911230130/ext/date/ -DPHP_ATOM_INC -I/tmp/php5.2-200911230130/include -I/tmp/php5.2-200911230130/main -I/tmp/php5.2-200911230130 -I/tmp/php5.2-200911230130/ext/date/lib -I/opt/libxml2-2.6.32/include/libxml2 -I/tmp/php5.2-200911230130/TSRM -I/tmp/php5.2-200911230130/Zend  -D_POSIX_PTHREAD_SEMANTICS  -I/usr/include -g -O2  -c /tmp/php5.2-200911230130/ext/date/php_date.c -o ext/date/php_date.lo 
/tmp/php5.2-200911230130/ext/date/php_date.c:38: parse error before `llabs'
/tmp/php5.2-200911230130/ext/date/php_date.c:38: parse error before `i'
/tmp/php5.2-200911230130/ext/date/php_date.c:38: conflicting types for `llabs'
/usr/include/stdlib.h:203: previous declaration of `llabs'
/tmp/php5.2-200911230130/ext/date/php_date.c: In function `llabs':
/tmp/php5.2-200911230130/ext/date/php_date.c:38: `i' undeclared (first use in this function)
/tmp/php5.2-200911230130/ext/date/php_date.c:38: (Each undeclared identifier is reported only once
/tmp/php5.2-200911230130/ext/date/php_date.c:38: for each function it appears in.)


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-11-28 00:38 UTC] svn@php.net
Automatic comment from SVN on behalf of jani
Revision: http://svn.php.net/viewvc/?view=revision&revision=291371
Log: - Fixed bug #50266 (conflicting types for llabs)
 [2010-02-03 21:56 UTC] jani@php.net
This fix caused bug #50930 (any idea if you get same result?)
 [2010-02-22 15:36 UTC] selsky at columbia dot edu
5.2.12 worked just fine.

I tested snapshot php5.2-201002221330, and I now get a segfault.  I'm 
having trouble getting a backtrace on the core file.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 15:01:30 2024 UTC