#47831 [Opn->Csd]: Compile warning for strnlen() in main/spprintf.c (missing #define _GNU_SOURCE)

[email protected]
Newsgroups php.bugs
Message-ID <[email protected]>
 ID:               47831
 Updated by:       [email protected]
 Reported By:      rainer dot jung at kippdata dot de
-Status:           Open
+Status:           Closed
 Bug Type:         Compile Warning
 Operating System: Linux
 PHP Version:      5.2.9
 New Comment:

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.




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

[2009-03-29 20:00:38] rainer dot jung at kippdata dot de

Description:
------------
PHP 5.2.9 does auto detection for strnlen(). On Linux the detection
results in strnlen() availability.

The function is only available, when _GNU_SOURCE is defined though.
File main/spprintf.c uses it without _GNU_SOURCE in PHP 5.2.9.

This is due to an incomplete backport from MAIN and 5.3.

See 

http://cvs.php.net/viewvc.cgi/php-src/main/spprintf.c?r1=1.25.2.2.2.10.2.4&r2=1.25.2.2.2.10.2.5
and
http://cvs.php.net/viewvc.cgi/php-src/main/spprintf.c?r1=1.53&r2=1.54&

and compare with

http://cvs.php.net/viewvc.cgi/php-src/main/spprintf.c?r1=1.25.2.2.2.14&r2=1.25.2.2.2.15

Patch:

--- main/spprintf.c      2009-02-04 16:03:12.000000000 +0100
+++ main/spprintf.c      2009-03-29 21:58:10.000000000 +0200
@@ -76,6 +76,7 @@
  * SIO stdio-replacement strx_* functions by Panos Tsirigotis
  * <[email protected]> for xinetd.
  */
+#define _GNU_SOURCE
 #include "php.h"

 #include <stddef.h>




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


-- 
Edit this bug report at http://bugs.php.net/?id=47831&edit=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.