Edit report at https://bugs.php.net/bug.php?id=55172&edit=1

 ID:                 55172
 Comment by:         info at richard5 dot net
 Reported by:        josh at joshbutts dot com
 Summary:            Compile fails on sprintf.lo
 Status:             Open
 Type:               Bug
 Package:            Compile Failure
 Operating System:   MacOS 10.7
 PHP Version:        5.3.6
 Block user comment: N
 Private report:     N

 New Comment:

Found the same error. However when I used a Mac that had a clean install of OSX 
10.7 aka Lion and Xcode 4.1 I had no problem. 
This error only occurred on an machine that I upgraded to Lion.


Previous Comments:
------------------------------------------------------------------------
[2011-07-10 23:02:54] josh at joshbutts dot com

Wonder if this might be a problem with detecting the presence of strnlen().

Commenting this in main/sprintf.c fixes the problem:
#if !HAVE_STRNLEN
static size_t strnlen(const char *s, size_t maxlen) {
        char *r = memchr(s, '\0', maxlen);
        return r ? r-s : maxlen;
}
#endif

------------------------------------------------------------------------
[2011-07-10 21:16:13] josh at joshbutts dot com

Description:
------------
When downloading the source tarball for 5.3.6, a vanilla ./configure followed 
by a make fails. 


gcc info:
i686-apple-darwin11-llvm-gcc-4.2

Expected result:
----------------
No error

Actual result:
--------------
/Users/josh/php-5.3.6/main/spprintf.c:186: error: static declaration of 
‘strnlen’ follows non-static declaration
/usr/include/string.h:143: error: previous declaration of ‘strnlen’ was here
make: *** [main/spprintf.lo] Error 1


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



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

Reply via email to