Bug #51183 [NEW]: ext/date/php_date.c fails to compile with Sun Studio and PHP 5.2.13

From: Date: Tue, 02 Mar 2010 12:25:23 +0000
Subject: Bug #51183 [NEW]: ext/date/php_date.c fails to compile with Sun Studio and PHP 5.2.13
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-148169@lists.php.net to get a copy of this message
From:             
Operating system: Solaris 10 (Sparc)
PHP version:      5.2.13
Package:          Compile Failure}
Bug Type:         Bug
Bug description:ext/date/php_date.c fails to compile with Sun Studio and PHP 5.2.13

Description:
------------
PHP 5.2.13 doesn't compile with Sun Studio compiler on Solaris 10 Sparc.
Configure works fine (as in 5.2.12), Make fails on ext/date/php_date.c file
with:

/bin/sh /opt/build/php/php-5.2.13/libtool --silent --preserve-dup-deps
--mode=compile cc -Iext/date/lib -Iext/date/
-I/opt/build/php/php-5.2.13/ext/d
ate/ -DPHP_ATOM_INC -I/opt/build/php/php-5.2.13/include
-I/opt/build/php/php-5.2.13/main -I/opt/build/php/php-5.2.13
-I/opt/build/php/php-5.2.13/ext/
date/lib -I/opt/build/php/ext/libxml2/include/libxml2 -I/usr/sfw/include
-I/opt/build/php/ext/curl/include -I/opt/build/php/ext/jpeg/include
-I/opt/b
uild/php/ext/freetype2/include
-I/opt/build/php/ext/freetype2/include/freetype2
-I/opt/build/php/ext/gettext/include -I/opt/build/php/ext/libiconv/in
clude -I/opt/build/php/php-5.2.13/ext/mbstring/oniguruma
-I/opt/build/php/php-5.2.13/ext/mbstring/libmbfl
-I/opt/build/php/php-5.2.13/ext/mbstring/li
bmbfl/mbfl -I/opt/build/php/ext/libmcrypt/include
-I/opt/build/php/ext/freetds/include -I/opt/build/php/ext/mysql/include
-I/opt/build/php/ext/instan
tclient/sdk/include -I/opt/build/php/ext/tidy/include
-I/opt/build/php/ext/xmlrpc-epi/include
-I/opt/build/php/ext/libxslt/include -I/opt/build/php/p
hp-5.2.13/TSRM -I/opt/build/php/php-5.2.13/Zend 
-I/opt/build/php/php/ext/libiconv/include
-I/opt/build/php/php/ext/gettext/include -D_POSIX_PTHREAD_
SEMANTICS  -I/opt/build/php/ext/libiconv/include -O -xs -xstrconst
-zlazyload -xmemalign=8s  -c /opt/build/php/php-5.2.13/ext/date/php_date.c
-o ext/
date/php_date.lo
"/opt/build/php/php-5.2.13/ext/date/php_date.c", line 38: warning: no
explicit type given
"/opt/build/php/php-5.2.13/ext/date/php_date.c", line 38: syntax error
before or at: long
cc: acomp failed for /opt/build/php/php-5.2.13/ext/date/php_date.c
*** Error code 1
make: Fatal error: Command failed for target `ext/date/php_date.lo'

A diff between 5.2.12 and 5.2.13 shows the culprit (php_date_llabs vs.
llabs and/or ifndef HAVE_LLABS, because of bug 50266 and bug 50930)

@@ -30,14 +30,12 @@
 #include "lib/timelib.h"
 #include <time.h>

-#ifndef HAVE_LLABS
-# ifdef PHP_WIN32
-static __inline __int64 llabs( __int64 i ) { return i >= 0? i: -i; }
-# elif defined(__GNUC__) && __GNUC__ < 3
-static __inline __int64_t llabs( __int64_t i ) { return i >= 0 ? i : -i;
}
-# elif defined(NETWARE) && defined(__MWERKS__)
-static __inline long long llabs( long long i ) { return i >= 0 ? i : -i;
}
-# endif
+#ifdef PHP_WIN32
+static __inline __int64 php_date_llabs( __int64 i ) { return i >= 0? i:
-i; }
+#elif defined(__GNUC__) && __GNUC__ < 3
+static __inline __int64_t php_date_llabs( __int64_t i ) { return i >= 0 ?
i : -i; }
+#else
+static __inline long long php_date_llabs( long long i ) { return i >= 0 ?
i : -i; }
 #endif

 /* {{{ arginfo */


Expected result:
----------------
successful compile

Actual result:
--------------
compile aborts with error

-- 
Edit bug report at http://bugs.php.net/bug.php?id=51183&edit=1
-- 
Try a snapshot (PHP 5.2):            http://bugs.php.net/fix.php?id=51183&r=trysnapshot52
Try a snapshot (PHP 5.3):            http://bugs.php.net/fix.php?id=51183&r=trysnapshot53
Try a snapshot (PHP 6.0):            http://bugs.php.net/fix.php?id=51183&r=trysnapshot60
Fixed in SVN:                        http://bugs.php.net/fix.php?id=51183&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=51183&r=needdocs
Fixed in release:                    http://bugs.php.net/fix.php?id=51183&r=alreadyfixed
Need backtrace:                      http://bugs.php.net/fix.php?id=51183&r=needtrace
Need Reproduce Script:               http://bugs.php.net/fix.php?id=51183&r=needscript
Try newer version:                   http://bugs.php.net/fix.php?id=51183&r=oldversion
Not developer issue:                 http://bugs.php.net/fix.php?id=51183&r=support
Expected behavior:                   http://bugs.php.net/fix.php?id=51183&r=notwrong
Not enough info:                     http://bugs.php.net/fix.php?id=51183&r=notenoughinfo
Submitted twice:                     http://bugs.php.net/fix.php?id=51183&r=submittedtwice
register_globals:                    http://bugs.php.net/fix.php?id=51183&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=51183&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=51183&r=dst
IIS Stability:                       http://bugs.php.net/fix.php?id=51183&r=isapi
Install GNU Sed:                     http://bugs.php.net/fix.php?id=51183&r=gnused
Floating point limitations:          http://bugs.php.net/fix.php?id=51183&r=float
No Zend Extensions:                  http://bugs.php.net/fix.php?id=51183&r=nozend
MySQL Configuration Error:           http://bugs.php.net/fix.php?id=51183&r=mysqlcfg



Thread (7 messages)

« previous php.bugs (#148169) next »