php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #17440 iconv fails to build on non-32-bit architectures
Submitted: 2002-05-26 14:30 UTC Modified: 2002-08-10 10:09 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: adconrad at 0c3 dot net Assigned:
Status: Closed Package: Compile Failure
PHP Version: 4.2.1 OS: Linux 2.4
Private report: No CVE-ID: None
 [2002-05-26 14:30 UTC] adconrad at 0c3 dot net
The complete build logs for 4.2.1 can be seen here (scroll to the bottom to get at recent versions):

http://buildd.debian.org/build.php?&pkg=php4

Click through on 4.2.1 s390, alpha, or ia64.  You'll notice the build failures on the first attempt.

This is due to an assumption that "unsigned int" == size_t, which isn't true on all architectures, only some.

... Adam

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-05-26 16:25 UTC] adconrad at 0c3 dot net
The build seems to go fine (with a warning about "passing arg 4 of `php_iconv_string' from incompatible pointer type", but there are warnings like that ALL over the PHP code when compiling on non-32-bit arches, that's nothing new) with the following simple patch applied.  I'm not the world's greatest C programmer by any stretch, so someone may want to double check that this one-line fix isn't doing something incredibly stupid:

------- Begin Patch ----------
--- php4-4.2.1.orig/ext/iconv/iconv.c   Thu Mar 21 13:25:25 2002
+++ php4-4.2.1/ext/iconv/iconv.c        Sun May 26 14:18:46 2002
@@ -87,7 +87,7 @@
 ZEND_GET_MODULE(iconv)
 #endif
 
-static int php_iconv_string(const char * in_str, unsigned int in_len, char ** out_str, unsigned int * out_len, const char * in_encoding, const char * out_encoding, int *err TSRMLS_DC);
+static int php_iconv_string(const char * in_str, size_t in_len, char ** out_str, size_t * out_len, const char * in_encoding, const char * out_encoding, int *err TSRMLS_DC);
 
 /* {{{ PHP_INI
  */
---------- End Patch ----------

... Adam
 [2002-08-10 10:09 UTC] kalowsky@php.net
This bug has been fixed in CVS. You can grab a snapshot of the
CVS version at http://snaps.php.net/. In case this was a documentation 
problem, the fix will show up soon at http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites.
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Jul 05 13:01:33 2025 UTC