From: Nikita Popov Date: Thu, 23 Jul 2020 08:35:40 +0000 (+0200) Subject: Fix some clang warnings X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=545928e4b8e8eb7d0f6ae5e4026edfad8757758e;p=php Fix some clang warnings --- 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[] = {