Skip to content

Commit 0119bbb

Browse files
committed
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]
1 parent 1c67a99 commit 0119bbb

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Zend/zend_operators.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2138,8 +2138,8 @@ ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2) /* {{{ */
21382138
{
21392139
int ret1, ret2;
21402140
int oflow1, oflow2;
2141-
long lval1, lval2;
2142-
double dval1, dval2;
2141+
long lval1 = 0, lval2 = 0;
2142+
double dval1 = 0.0, dval2 = 0.0;
21432143

21442144
if ((ret1=is_numeric_string_ex(Z_STRVAL_P(s1), Z_STRLEN_P(s1), &lval1, &dval1, 0, &oflow1)) &&
21452145
(ret2=is_numeric_string_ex(Z_STRVAL_P(s2), Z_STRLEN_P(s2), &lval2, &dval2, 0, &oflow2))) {

Zend/zend_operators.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ static inline zend_uchar is_numeric_string_ex(const char *str, int length, long
132132
{
133133
const char *ptr;
134134
int base = 10, digits = 0, dp_or_e = 0;
135-
double local_dval;
135+
double local_dval = 0.0;
136136
zend_uchar type;
137137

138138
if (!length) {

0 commit comments

Comments
 (0)