Bug #55172 [Opn]: Compile fails on sprintf.lo

From: Date: Mon, 11 Jul 2011 03:02:55 +0000
Subject: Bug #55172 [Opn]: Compile fails on sprintf.lo
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-161776@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=55172&edit=1

 ID:                 55172
 User updated by:    josh at joshbutts dot com
 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:

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


Previous Comments:
------------------------------------------------------------------------
[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


Thread (5 messages)

« previous php.bugs (#161776) next »