Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_execute_API.c
| From: | Andi Gutmans | Date: | Tue, 28 Sep 2004 20:11:42 +0000 |
| Subject: | Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_execute_API.c | ||
| References: | 1 2 3 4 5 6 | Groups: | php.zend-engine.cvs |
| Request: | Send a blank email to php-zend-engine-cvs+get-3058@lists.php.net to get a copy of this message | ||
Yeah, you can try and change it to zend_uint and see if you get any warnings (although not all compilers complain as much as others).
Andi
At 10:05 PM 9/28/2004 +0200, Marcus Boerger wrote:
Hello Andi, if we use it for a check only then shouldn't a) the compiler find where and b) it still work becuse -1 will translate to ~0 then? marcus Tuesday, September 28, 2004, 9:45:19 PM, you wrote: Yes, but we'd just need to be 100% sure that we're never assigning a negative number (like -1) to this value, for whatever reason it might be. Andi At 09:08 AM 9/28/2004 +0100, Wez Furlong wrote:we usedSurely a better fix is to fix the type in the struct? --Wez. On Mon, 27 Sep 2004 20:34:07 +0200, Marcus Boerger <helly@php.net> wrote:Hello Andi, Monday, September 27, 2004, 6:40:49 PM, you wrote:str.len used to be able to be -1. I can't quite remember when butbut notit to mark a special case. I am not sure if it's still required today. I prefer not casting such places so that we remember to check back and see why the warning is happening. You are only suppressing a warning17:43:32 2004fixing anything.Yep. I checked it and found out that the cast is ok. So suppressing that warning was good to avoid looking at it again and again. I asked because i was simply curious for the reason. No real need to change it. regards marcusYour previous commits were OK because they actually solved warnings without casting.AndiAt 08:50 AM 9/27/2004 +0000, Marcus Boerger wrote:uint/zend_uint?helly Mon Sep 27 04:50:43 2004 EDTModified files:/ZendEngine2 zend_execute_API.cLog: - Fix warning # What's the reason _zvalue_value.str.len is int instead of=1.300&ty=uhttp://cvs.php.net/diff.php/ZendEngine2/zend_execute_API.c?r1=1.299&r2Index: ZendEngine2/zend_execute_API.c diff -u ZendEngine2/zend_execute_API.c:1.299 ZendEngine2/zend_execute_API.c:1.300--- ZendEngine2/zend_execute_API.c:1.299 Thu Sep 23-- Best regards,-- Best regards,+----------------------------------------------------------------------++++ ZendEngine2/zend_execute_API.c Mon Sep 27 04:50:41 2004 @@ -17,7 +17,7 @@str_index,*/ -/* $Id: zend_execute_API.c,v 1.299 2004/09/23 21:43:32 andi Exp $ */ +/* $Id: zend_execute_API.c,v 1.300 2004/09/27 08:50:41 helly Exp $ */ #include <stdio.h> #include <signal.h> @@ -479,7 +479,7 @@continue; }- if (const_value.type == IS_STRING &&const_value.value.str.len == str_index_len-1 &&+ if (const_value.type == IS_STRING &&(uint)const_value.value.str.len == str_index_len-1 &&!strncmp(const_value.value.str.val,name */str_index_len)) {/* constant value is the same as itszval_dtor(&const_value);-- Zend Engine CVS Mailing List (http://cvs.php.net/) To unsubscribe, visit: http://www.php.net/unsub.phpMarcus mailto:helly@php.net-- Zend Engine CVS Mailing List (http://cvs.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php-- Zend Engine CVS Mailing List (http://cvs.php.net/) To unsubscribe, visit: http://www.php.net/unsub.phpMarcus mailto:helly@php.net