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

From: Date: Mon, 08 Mar 2010 19:26:07 +0000
Subject: Bug #51183 [Com]: ext/date/php_date.c fails to compile with Sun Studio and PHP 5.2.13
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-148404@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=51183&edit=1

 ID:               51183
 Comment by:       
 Reported by:      markus dot schiegl at lbbw dot de
 Summary:          ext/date/php_date.c fails to compile with Sun Studio
                   and PHP 5.2.13
 Status:           Assigned
 Type:             Bug
 Package:          Compile Failure
 Operating System: Solaris 10 (Sparc)
 PHP Version:      5.2.13
 Assigned To:      derick

 New Comment:

This also affects Solaris 10 x86 with Sun Studio compiler.


Previous Comments:
------------------------------------------------------------------------
[2010-03-05 11:42:12] markus dot schiegl at lbbw dot de

Jose Marcio, thanks for the patch. Compiles and works fine now!

------------------------------------------------------------------------
[2010-03-02 13:25:22] markus dot schiegl at lbbw dot de

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 this bug report at http://bugs.php.net/bug.php?id=51183&edit=1


Thread (7 messages)

« previous php.bugs (#148404) next »