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

From: Date: Thu, 10 Jun 2021 12:40:46 +0000
Subject: Bug #55172 [Opn->Fbk]: Compile fails on sprintf.lo
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-234334@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
 Updated by:         cmb@php.net
 Reported by:        josh at joshbutts dot com
 Summary:            Compile fails on sprintf.lo
-Status:             Open
+Status:             Feedback
 Type:               Bug
 Package:            Compile Failure
 Operating System:   MacOS 10.7
 PHP Version:        5.3.6
-Assigned To:        
+Assigned To:        cmb
 Block user comment: N
 Private report:     N

 New Comment:

Is that still an issue with any of the actively supported PHP
versions[1]?

[1] <https://www.php.net/supported-versions.php>


Previous Comments:
------------------------------------------------------------------------
[2011-07-23 19:29:01] info at richard5 dot net

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.

------------------------------------------------------------------------
[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


Thread (5 messages)

« previous php.bugs (#234334) next »