php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55172 Compile fails on sprintf.lo
Submitted: 2011-07-10 21:16 UTC Modified: 2021-06-20 04:22 UTC
Votes:6
Avg. Score:4.7 ± 0.5
Reproduced:6 of 6 (100.0%)
Same Version:3 (50.0%)
Same OS:4 (66.7%)
From: josh at joshbutts dot com Assigned: cmb (profile)
Status: No Feedback Package: Compile Failure
PHP Version: 5.3.6 OS: MacOS 10.7
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: josh at joshbutts dot com
New email:
PHP Version: OS:

 

 [2011-07-10 21:16 UTC] 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-07-10 23:02 UTC] 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-23 19:29 UTC] 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.
 [2021-06-10 12:40 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-06-10 12:40 UTC] cmb@php.net
Is that still an issue with any of the actively supported PHP
versions[1]?

[1] <https://www.php.net/supported-versions.php>
 [2021-06-20 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Tue Dec 05 15:01:28 2023 UTC