From 5834239cc0db135b3f0cca361d76f1f89fb84d51 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Sat, 11 Jun 2022 21:21:48 +0200 Subject: [PATCH] Fix redundant ZSTR_VAL condition in php_date.c ZSTR_VAL can never be NULL as zend_string.val is a char[1] which will always decay to a non-nullable pointer. This fails with -Werror on newer gcc versions. --- ext/date/php_date.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/date/php_date.c b/ext/date/php_date.c index f381d65cefa7e..660b15c5dae46 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -477,7 +477,7 @@ timelib_tzinfo *php_date_parse_tzfile_wrapper(const char *formal_tzname, const t /* {{{ static PHP_INI_MH(OnUpdate_date_timezone) */ static PHP_INI_MH(OnUpdate_date_timezone) { - if (new_value && ZSTR_VAL(new_value) && !timelib_timezone_id_is_valid(ZSTR_VAL(new_value), DATE_TIMEZONEDB)) { + if (new_value && !timelib_timezone_id_is_valid(ZSTR_VAL(new_value), DATE_TIMEZONEDB)) { php_error_docref( NULL, E_WARNING, "Invalid date.timezone value '%s', using '%s' instead",