ID:               50496
 Updated by:       johan...@php.net
 Reported By:      alexander at skwar dot name
 Status:           Assigned
 Bug Type:         Compile Failure
 Operating System: Solaris 10, Sparc
 PHP Version:      5.3SVN-2009-12-16 (snap)
 Assigned To:      srinatar
 New Comment:

This is changing it globally, no? - Might this have negative effects (I
don't know if C99 breaks C89 code in anyway, while in general I'd like
to move to C99 due to the types and some other stuff it offers)

And might we have trouble with other non-gcc platforms?


Previous Comments:
------------------------------------------------------------------------

[2009-12-16 20:12:39] paj...@php.net

hi,

Thanks for the quick work :)

As long as it affects only Solaris/OpenSolaris, go ahead with the
commit.

It is not necessary to backport this fix to 5.2 as the crypt addition
has been done only in 5.3+.

------------------------------------------------------------------------

[2009-12-16 20:10:09] srina...@php.net

Sun Studio compiler does not by default enable ANSIC C99 standard and 
its extensions and need to be explicitly enabled. !

this patch addresses this patch by enabling ANSIC99 standard. 

[srir...@chilidev]'PHP_5_3'>svn diff acinclude.m4                      
                                                                        
           
Index: acinclude.m4
===================================================================
--- acinclude.m4        (revision 292219)
+++ acinclude.m4        (working copy)
@@ -2780,7 +2780,7 @@
     AC_MSG_RESULT([no]),
     SUNCC="yes"
     GCC="no"
-    test -n "$auto_cflags" && CFLAGS="-O -xs -xstrconst -zlazyload"
+    test -n "$auto_cflags" && CFLAGS="-O -xc99=all -xs -xstrconst -
zlazyload"
     GCC=""
     AC_MSG_RESULT([yes])
   )

if no one has any objections, i will commit this patch

here is the complete patch
Index: trunk/acinclude.m4
===================================================================
--- trunk/acinclude.m4  (revision 292220)
+++ trunk/acinclude.m4  (working copy)
@@ -2780,7 +2780,7 @@
     AC_MSG_RESULT([no]),
     SUNCC="yes"
     GCC="no"
-    test -n "$auto_cflags" && CFLAGS="-O -xs -xstrconst -zlazyload"
+    test -n "$auto_cflags" && CFLAGS="-O -xc99=all -xs -xstrconst -
zlazyload"
     GCC=""
     AC_MSG_RESULT([yes])
   )
Index: branches/PHP_5_3/acinclude.m4
===================================================================
--- branches/PHP_5_3/acinclude.m4       (revision 292219)
+++ branches/PHP_5_3/acinclude.m4       (working copy)
@@ -2780,7 +2780,7 @@
     AC_MSG_RESULT([no]),
     SUNCC="yes"
     GCC="no"
-    test -n "$auto_cflags" && CFLAGS="-O -xs -xstrconst -zlazyload"
+    test -n "$auto_cflags" && CFLAGS="-O -xc99=all -xs -xstrconst -
zlazyload"
     GCC=""
     AC_MSG_RESULT([yes])
   )
Index: branches/PHP_5_3/NEWS
===================================================================
--- branches/PHP_5_3/NEWS       (revision 292219)
+++ branches/PHP_5_3/NEWS       (working copy)
@@ -9,6 +9,8 @@
 - Changed "post_max_size" php.ini directive to allow unlimited post 
size by
   setting it to 0. (Rasmus)
 
+- Fixed bug #50496 (Use of <stdbool.h> is valid only in a c99 
compilation 
+  environment. (Sriram)
 - Added support for SHA-256 and SHA-512 to php's crypt. (Pierre)
 - Added realpath_cache_size() and realpath_cache_get() functions. 
(Stas)
 - Added FILTER_FLAG_STRIP_BACKTICK option to the filter extension. 
(Ilia)

I will enable xc99=all option in php 5.2 branch after 5.2.12 is 
released.

------------------------------------------------------------------------

[2009-12-16 18:25:36] srina...@php.net

yup, will look into this today.

------------------------------------------------------------------------

[2009-12-16 18:09:30] paj...@php.net

That code is new in 5.3.1, it adds (or restore when SHA-512/256 was
available on the system) features to crypt.

Ah, that could be the problem. I tested using OpenSolaris on a t2000
box. I have no solaris to test.

@srinatar, can you take a look at this issue please? That would be very
helpful :)

------------------------------------------------------------------------

[2009-12-16 17:30:09] alexander at skwar dot name

Hm.

That's strange. It shouldn't be depending on the version of Solaris. In
/usr/include/stdbool.h, there is:


#else /* _STDC_C99 */

#error "Use of <stdbool.h> is valid only in a c99 compilation
environment."

#endif /* _STDC_C99 */

So, for some reason or the other, you had _STDC_C99 defined. This
should only be defined if compiling in C99 mode.

I'm right now downloading Solaris 10 U8 to install it in a Virtual Box
together with Sun Studio 12.1. I expect it to error out.

Out of curiosity: Which version of Solaris 10 are you using? U8? I'm
*NOT* using OpenSolaris, BTW. And I find it quite curious that php-5.3.0
compiles and php-5.3.1+ does not. The only difference is the source code
of PHP. This kinda leads me to think, that the problem is related to
PHP.

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/50496

-- 
Edit this bug report at http://bugs.php.net/?id=50496&edit=1

Reply via email to