com php-src: Fix some clang warnings: ext/intl/dateformat/datef ormat_parse.c ext/mysqli/mysqli_nonapi.c ext/mysqli /php_mysqli_structs.h
ext/opcache/jit/zend_jit_x8 6.dasc
| From: | Nikita Popov | Date: | Thu, 23 Jul 2020 08:35:40 +0000 |
| Subject: | com php-src: Fix some clang warnings: ext/intl/dateformat/datef ormat_parse.c ext/mysqli/mysqli_nonapi.c ext/mysqli /php_mysqli_structs.h ext/opcache/jit/zend_jit_x8 6.dasc |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-112332@lists.php.net to get a copy of this message | ||
Commit: 545928e4b8e8eb7d0f6ae5e4026edfad8757758e
Author: Nikita Popov <nikita.ppv@gmail.com> Thu, 23 Jul 2020 10:35:40 +0200
Parents: b6b6e76937623e39732f293022de889b6fd51c96
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=545928e4b8e8eb7d0f6ae5e4026edfad8757758e
Log:
Fix some clang warnings
Changed paths:
M ext/intl/dateformat/dateformat_parse.c
M ext/mysqli/mysqli_nonapi.c
M ext/mysqli/php_mysqli_structs.h
M ext/opcache/jit/zend_jit_x86.dasc
Diff:
diff --git a/ext/intl/dateformat/dateformat_parse.c b/ext/intl/dateformat/dateformat_parse.c
index 0089fbe5b6..f5c73a1245 100644
--- a/ext/intl/dateformat/dateformat_parse.c
+++ b/ext/intl/dateformat/dateformat_parse.c
@@ -51,7 +51,7 @@ static void internal_parse_to_timestamp(IntlDateFormatter_object *dfo, char* tex
/* Since return is in sec. */
result = (double)timestamp / U_MILLIS_PER_SECOND;
- if(result > LONG_MAX || result < -LONG_MAX) {
+ if (result > (double)LONG_MAX || result < (double)LONG_MIN) {
ZVAL_DOUBLE(return_value, result<0?ceil(result):floor(result));
} else {
ZVAL_LONG(return_value, (zend_long)result);
diff --git a/ext/mysqli/mysqli_nonapi.c b/ext/mysqli/mysqli_nonapi.c
index ba97e0aa24..5dc16b9552 100644
--- a/ext/mysqli/mysqli_nonapi.c
+++ b/ext/mysqli/mysqli_nonapi.c
@@ -734,7 +734,7 @@ static int mysqlnd_zval_array_to_mysqlnd_array(zval *in_array, MYSQLND ***out_ar
return FAILURE;
}
mysql = (MY_MYSQL*) my_res->ptr;
- if (MYSQLI_STATUS_VALID && my_res->status < MYSQLI_STATUS_VALID) {
+ if (my_res->status < MYSQLI_STATUS_VALID) {
zend_throw_error(NULL, "%s object is not fully initialized",
ZSTR_VAL(intern->zo.ce->name));
return FAILURE;
}
diff --git a/ext/mysqli/php_mysqli_structs.h b/ext/mysqli/php_mysqli_structs.h
index 43c9b64fa8..f02da59848 100644
--- a/ext/mysqli/php_mysqli_structs.h
+++ b/ext/mysqli/php_mysqli_structs.h
@@ -229,7 +229,7 @@ extern void php_mysqli_fetch_into_hash_aux(zval *return_value, MYSQL_RES * resul
RETURN_THROWS();\
}\
__ptr = (__type)my_res->ptr; \
- if (__check && my_res->status < __check) { \
+ if (my_res->status < __check) { \
zend_throw_error(NULL, "%s object is not fully initialized",
ZSTR_VAL(intern->zo.ce->name)); \
RETURN_THROWS();\
}\
@@ -243,7 +243,7 @@ extern void php_mysqli_fetch_into_hash_aux(zval *return_value, MYSQL_RES * resul
return;\
}\
__ptr = (__type)my_res->ptr; \
- if (__check && my_res->status < __check) { \
+ if (my_res->status < __check) { \
zend_throw_error(NULL, "%s object is not fully initialized",
ZSTR_VAL(intern->zo.ce->name)); \
return;\
}\
diff --git a/ext/opcache/jit/zend_jit_x86.dasc b/ext/opcache/jit/zend_jit_x86.dasc
index 605295758a..97e1269323 100644
--- a/ext/opcache/jit/zend_jit_x86..dasc
+++ b/ext/opcache/jit/zend_jit_x86.dasc
@@ -110,6 +110,7 @@
#if defined(__clang__)
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wtautological-compare"
+# pragma clang diagnostic ignored "-Wstring-compare"
#endif
const char* zend_reg_name[] = {