Re: Bug #717 Updated: The type of array keys is being lost

From: Date: Thu, 17 Sep 1998 11:40:07 +0000
Subject: Re: Bug #717 Updated: The type of array keys is being lost
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-1193@lists.php.net to get a copy of this message
Zeev, I've done some further tests on this problem. The problem starts appearing when the string/number reaches 2^31 - I get :- Setting array string element 2147483647 with 1 Got array integer element 2147483647 = 1 ... and ... Setting array string element 2147483648 with 1 Got array integer element -2147483648 = 1 Note that LONG_MAX on the Alpha is 9223372036854775807 - ie 2^63 - 1, so none of my sample numbers are causing strtol() to overflow. It would appear as if something is mixing up it's LONGs with it's INTs - INT_MAX is 2147483647 BUT - even when the procedure is working correctly, why does it report something that I took great care to tell the interpreter was a string as an integer? When compiling, I had to #undef MOD_SSL in ../apache_1.3.1/src/include/buff.h, and I got the following warnings :- cc: Warning: snprintf.c, line 935: Source file does not contain any declarations. cc: Warning: fopen-wrappers.c, line 472: In this statement, the referenced type of the pointer value "scratch" is "signed char", which is not compatible with "const unsigned char". cc: Warning: /usr/include/arpa/nameser.h, line 111: The redefinition of the macro "STATUS" conflicts with a current definition because the replacement lists differ. The redefinition is now in effect. cc: Warning: functions/dns.c, line 279: In this statement, & before array "ans" is ignored. cc: Warning: functions/dns.c, line 284: In this statement, & before array "ans" is ignored. cc: Warning: functions/dns.c, line 285: In this statement, & before array "ans" is ignored. cc: Warning: functions/dns.c, line 286: In this statement, & before array "ans" is ignored. cc: Warning: functions/md5.c, line 68: In this statement, the referenced type of the pointer value "arg->value.str.val" is "signed char", which is not compatible with "unsigned char". cc: Warning: functions/mysql.c, line 1478: In this statement, the referenced type of the pointer value "mysql_fetch_lengths(...)" is "unsigned int", which is not compatible with "int". cc: Warning: functions/base64.c, line 154: In this statement, the referenced type of the pointer value "string->value.str.val" is "signed char", which is not compatible with "const unsigned char". cc: Warning: functions/base64.c, line 156: In this statement, the referenced type of the pointer value "result" is "unsigned char", which is not compatible with "signed char". cc: Warning: functions/base64.c, line 174: In this statement, the referenced type of the pointer value "string->value.str.val" is "signed char", which is not compatible with "const unsigned char". cc: Warning: functions/base64.c, line 176: In this statement, the referenced type of the pointer value "result" is "unsigned char", which is not compatible with "signed char". cc: Warning: functions/gdttf.c, line 792: Source file does not contain any declarations. cc: Warning: functions/gdcache.c, line 197: Source file does not contain any declarations. cc: Warning: functions/dlist.c, line 401: Source file does not contain any declarations. On 10 Sep 1998, Bug Database wrote: > ID: 717 > Updated by: zeev > Reported By: obyrne@iol.ie > Status: Assigned > Bug Type: Misbehaving function > Assigned To: zeev > Comments: > > This is most interesting. It doesn't happen on any platform I've tested it with, > mainly because we've added code > to protect against it. It seems that for some reason strtol() isn't returning LONG_MAX > even though it's overflowing. > > In order to further identify and trace this bug, I'm afraid I'll need access to that > platform. If you or anybody else > can arrange for a DEC Unix account for this purpose (for a short period of time), I'm sure > it can be fixed. > > Full Bug description available at: > http://ca.php.net/bugs.php3?id=717 > -- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net For help: php-dev-help@lists.php.net

« previous php.dev (#1193) next »