Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_hash.c
| From: | Andi Gutmans | Date: | Tue, 05 Nov 2002 06:23:11 +0000 |
| Subject: | Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_hash.c | ||
| References: | 1 2 3 | Groups: | php.zend-engine.cvs |
| Request: | Send a blank email to php-zend-engine-cvs+get-558@lists.php.net to get a copy of this message | ||
At 08:33 AM 11/5/2002 -0500, Ilia A. wrote:
On November 5, 2002 08:22 am, Zeev Suraski wrote: At 14:20 05/11/2002, Ilia A. wrote:I think if the compiler is wrong we shouldn't fix it. Theoretically such an assignment slows down the function. So why should we make the code worse just so that we don't see a warning (and I have personally never seen this warning). In general, I don't think everything should be done to get rid of warnings if it doesn't make sense. I feel the same about other patches I've seen in the past which make the code much uglier just to get rid of the warning (I'm not talking about this patch but patches which cast a million places). AndiFirst there is the compiler warning about un-initialized variable, which would occur if ordered is null. If that can never happen then this is just a compiler warning fix. If it can happen, then this prevents a possible undefined behaviour because p2 would be used without having it's value set, meaning that that any random value could be in there.It doesn't happen, I also don't recall ever seeing a compiler warning about it (the compiler should be bright enough to see that for itself...). What compiler are we talking about here? gcc 2.95.3 I got the error when I compiled ZE2 with -O3 -g3 -Wall flags.