#47831 [NEW]: Compile warning for strnlen() in main/spprintf.c (missing #define _GNU_SOURCE)
| From: | rainer dot jung at kippdata dot de | Date: | Sun, 29 Mar 2009 20:00:38 +0000 |
| Subject: | #47831 [NEW]: Compile warning for strnlen() in main/spprintf.c (missing #define _GNU_SOURCE) | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-135283@lists.php.net to get a copy of this message | ||
From: rainer dot jung at kippdata dot de
Operating system: Linux
PHP version: 5.2.9
PHP Bug Type: Compile Warning
Bug description: Compile warning for strnlen() in main/spprintf.c (missing #define _GNU_SOURCE)
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
* <panos@alumni.cs.colorado.edu> for xinetd.
*/
+#define _GNU_SOURCE
#include "php.h"
#include <stddef.h>
--
Edit bug report at http://bugs.php.net/?id=47831&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=47831&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=47831&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=47831&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=47831&r=fixedcvs
Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=47831&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=47831&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=47831&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=47831&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=47831&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=47831&r=support
Expected behavior: http://bugs.php.net/fix.php?id=47831&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=47831&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=47831&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=47831&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=47831&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=47831&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=47831&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=47831&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=47831&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=47831&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=47831&r=mysqlcfg