Bug #18588: array_diff does not work.
| From: | nohn@php.net | Date: | Fri, 26 Jul 2002 09:02:13 +0000 |
| Subject: | Bug #18588: array_diff does not work. | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-15310@lists.php.net to get a copy of this message | ||
From: nohn@php.net
Operating system: OSF1 V4.0 1530
PHP version: 4CVS-2002-07-26
PHP Bug Type: Compile Warning
Bug description: array_diff does not work.
These warnings come up:
cc: Warning: /usr/users/nohn/php4-200207260000/ext/mbstring/mbstring.c,
line 2469: In this statement, the referenced type of the pointer value
"&size" is "int", which is not compatible with "unsigned long".
(ptrmismatch)
ret = php_mb_convert_encoding( Z_STRVAL_PP(arg_str),
Z_STRLEN_PP(arg_str), Z_STRVAL_PP(arg_new), _from_encodings, &size
TSRMLS_CC);
--------------------------------------------------------------------------------------------------------------------------^
cc: Warning: /usr/users/nohn/php4-200207260000/ext/mbstring/mbstring.c,
line 2543: In this statement, the referenced type of the pointer value
"(**arg_str).value.str.val" is "signed char", which is not compatible with
"unsigned char". (ptrmismatch)
string.val = Z_STRVAL_PP(arg_str);
--------^
cc: Warning: /usr/users/nohn/php4-200207260000/ext/mbstring/mbstring.c,
line 2618: In this statement, the referenced type of the pointer value
"(**argv[0]).value.str.val" is "signed char", which is not compatible with
"unsigned char". (ptrmismatch)
string.val = Z_STRVAL_PP(argv[0]);
--------^
cc: Warning: /usr/users/nohn/php4-200207260000/ext/mbstring/mbstring.c,
line 2622: In the initializer for __s, the referenced type of the pointer
value "(ret->val)" is "unsigned char", which is not compatible with
"signed char". (ptrmismatch)
RETVAL_STRINGL(ret->val, ret->len, 0) /* the string is
already strdup()'ed */
----------------^
cc: Warning: /usr/users/nohn/php4-200207260000/ext/mbstring/mbstring.c,
line 2646: In this statement, the referenced type of the pointer value
"(**arg_str).value.str.val" is "signed char", which is not compatible with
"unsigned char". (ptrmismatch)
string.val = Z_STRVAL_PP(arg_str);
--------^
cc: Warning: /usr/users/nohn/php4-200207260000/ext/mbstring/mbstring.c,
line 2650: In the initializer for __s, the referenced type of the pointer
value "(ret->val)" is "unsigned char", which is not compatible with
"signed char". (ptrmismatch)
RETVAL_STRINGL(ret->val, ret->len, 0) /* the string is
already strdup()'ed */
cc: Warning: /usr/users/nohn/php4-200207260000/ext/mbstring/mbstring.c,
line 2682: In this statement, the referenced type of the pointer value
"(**arg1).value.str.val" is "signed char", which is not compatible with
"unsigned char". (ptrmismatch)
string.val = Z_STRVAL_PP(arg1);
--------^
cc: Warning: /usr/users/nohn/php4-200207260000/ext/mbstring/mbstring.c,
line 2767: In the initializer for __s, the referenced type of the pointer
value "(ret->val)" is "unsigned char", which is not compatible with
"signed char". (ptrmismatch)
RETVAL_STRINGL(ret->val, ret->len, 0); /* the
string is already strdup()'ed */
----------------^
cc: Warning: /usr/users/nohn/php4-200207260000/ext/mbstring/mbstring.c,
line 2884: In this statement, the referenced type of the pointer value
"(**hash_entry).value.str.val" is "signed char", which is not compatible
with "unsigned char". (ptrmismatch)
string.val = Z_STRVAL_PP(hash_entry);
------------------------------------------------------------------------^
cc: Warning: /usr/users/nohn/php4-200207260000/ext/mbstring/mbstring.c,
line 2893: In this statement, the referenced type of the pointer value
"(**var).value.str.val" is "signed char", which is not compatible with
"unsigned char". (ptrmismatch)
string.val =
Z_STRVAL_PP(var);
------------------------------------------------^
cc: Warning: /usr/users/nohn/php4-200207260000/ext/mbstring/mbstring.c,
line 2973: In this statement, the referenced type of the pointer value
"(**hash_entry).value.str.val" is "signed char", which is not compatible
with "unsigned char". (ptrmismatch)
string.val
= Z_STRVAL_PP(hash_entry);
----------------------------------------------------------------^
cc: Warning: /usr/users/nohn/php4-200207260000/ext/mbstring/mbstring.c,
line 2978: In this statement, the referenced type of the pointer value
"ret->val" is "unsigned char", which is not compatible with "signed
char".
(ptrmismatch)
Z_STRVAL_PP(hash_entry) = ret->val;
(and some more)
========================================================
========================================================
Originally i wanted to report this, but it seems fixed ;)
On OSF1 V4.0 1530 alpha
'./configure' '--prefix=/usr/local'
'--with-apache=/usr/local/Apachetoolbox-1.5.56/apache_1.3.24'
'--enable-exif' '--enable-track-vars' '--with-calendar=shared'
'--enable-safe-mode' '--enable-magic-quotes' '--enable-trans-sid'
'--enable-wddx' '--enable-ftp' '--with-openssl=/usr/local'
'--with-oci8=/appl/oracle/product/8.1.6' '--with-mysql=/usr/local/mysql'
PHP 4.2.0 produces this:
Array
(
[0] => 7
[2] => 9
)
Array
(
[0] => 9
[1] => 7
[2] => 8
)
-----
With php4-200207260000 (php4-latest.tar.gz) this happens on the same
machine:
'./configure' '--prefix=/usr/users/nohn'
./php diff.php
Unaligned access pid=19451 <php> va=0x140062cac pc=0x1201aace0
ra=0x1201aacd4 inst=0xb4010000
Array
(
[0] => 7
[2] => 9
)
Array
(
[0] => 9
[1] => 7
)
-----
On SunOS 5.7 Generic_106541-15 sun4us sparc FJSV,GPUS this happens:
'./configure' '--prefix=/usr/local'
'--with-apache=/export/home/lket/Apachetoolbox-1.5.58/apache_1.3.26'
'--enable-exif' '--enable-track-vars' '--with-calendar=shared'
'--enable-magic-quotes' '--enable-trans-sid' '--enable-wddx'
'--enable-ftp' '--enable-inline-optimization' '--enable-memory-limit'
'--with-gd=/usr/local' '--with-zlib' '--enable-gd-native-tt'
'--with-t1lib=/usr/local' '--with-jpeg-dir=/usr/local'
'--with-png-dir=/usr/local' '--with-zlib-dir=/usr/local' '--with-ttf'
'--with-freetype-dir=/usr/local' '--with-oci8=/appl/oracle/product/8.1.7'
Array
(
[0] => 7
[2] => 9
)
Array
(
[0] => 9
[1] => 7
)
--
Edit bug report at http://bugs.php.net/?id=18588&edit=1
--
Fixed in CVS: http://bugs.php.net/fix.php?id=18588&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=18588&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=18588&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=18588&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=18588&r=support
Expected behavior: http://bugs.php.net/fix.php?id=18588&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=18588&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=18588&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=18588&r=globals