com php-src: Fixed compiler warnings: Zend/zend_operators.c Zend/zend_operators.h
| From: | Anatol Belski | Date: | Wed, 16 Oct 2013 08:17:09 +0000 |
| Subject: | com php-src: Fixed compiler warnings: Zend/zend_operators.c Zend/zend_operators.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-73562@lists.php.net to get a copy of this message | ||
Commit: c4edc6e27784cffece62ee96da3cac13ddd0500c
Author: Xinchen Hui <laruence@php.net> Tue, 27 Aug 2013 15:44:30 +0800
Committer: Anatol Belski <ab@php.net> Wed, 16 Oct 2013 01:17:09 -0700
Parents: 6a2c44c81178dc661b09dd5b32e1d50a8c7235e4
Branches: str_size_and_int64
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=c4edc6e27784cffece62ee96da3cac13ddd0500c
Log:
Fixed compiler warnings
warning: 'local_dval' may be used uninitialized in this function
[-Wmaybe-uninitialized]
warning: 'dval2' may be used uninitialized in this function
[-Wmaybe-uninitialized]
Changed paths:
M Zend/zend_operators.c
M Zend/zend_operators.h
Diff:
diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c
index c779e57..39c1d34 100644
--- a/Zend/zend_operators.c
+++ b/Zend/zend_operators.c
@@ -2234,8 +2234,8 @@ ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2) /* {{{ */
{
int ret1, ret2;
int oflow1, oflow2;
- zend_int_t lval1, lval2;
- double dval1, dval2;
+ zend_int_t lval1 = 0, lval2 = 0;
+ double dval1 = 0, dval2 = 0;
if ((ret1=is_numeric_string_ex(Z_STRVAL_P(s1), Z_STRSIZE_P(s1), &lval1, &dval1, 0,
&oflow1)) &&
(ret2=is_numeric_string_ex(Z_STRVAL_P(s2), Z_STRSIZE_P(s2), &lval2, &dval2, 0,
&oflow2))) {
diff --git a/Zend/zend_operators.h b/Zend/zend_operators.h
index 2db8777..03fbce2 100644
--- a/Zend/zend_operators.h
+++ b/Zend/zend_operators.h
@@ -132,7 +132,7 @@ static inline zend_uchar is_numeric_string_ex(const char *str, zend_str_size_int
{
const char *ptr;
int base = 10, digits = 0, dp_or_e = 0;
- double local_dval;
+ double local_dval = 0.0;
zend_uchar type;
if (!length) {