[php-src] PR #16650: Fix compiler warning

From: Date: Wed, 30 Oct 2024 11:29:32 +0000
Subject: [php-src] PR #16650: Fix compiler warning
Groups: php.git-pulls 
Request: Send a blank email to git-pulls+get-29443@lists.php.net to get a copy of this message
Pull Request: https://github.com/php/php-src/pull/16650 Author: arnaud-lb This fixes the following warning with gcc 14: ``` ext/zend_test/observer.c: In function ‘zend_test_observer_OnUpdateCommaList’: ext/zend_test/observer.c:318:115: error: the comparison will always evaluate as ‘true’ for the pointer operand in ‘(((long unsigned int)func->common.run_time_cache__ptr & 1) != 0 ? (void **)*((void **)compiler_globals.map_ptr_base + (sizetype)func->common.run_time_cache__ptr) : func->common.run_time_cache__ptr) + (((unsigned char)func->type) != 1 ? (sizetype)((long unsigned int)zend_observer_fcall_op_array_extension * 8) : (sizetype)((long unsigned int)zend_observer_fcall_internal_function_extension * 8))’ must not be NULL [-Werror=address] 318 | if ((func = zend_hash_find_ptr(EG(function_table), funcname)) && ZEND_OBSERVER_DATA(func) != NULL) { | ^~ ext/zend_test/observer.c:341:123: error: the comparison will always evaluate as ‘true’ for the pointer operand in ‘(((long unsigned int)func->common.run_time_cache__ptr & 1) != 0 ? (void **)*((void **)compiler_globals.map_ptr_base + (sizetype)func->common.run_time_cache__ptr) : func->common.run_time_cache__ptr) + (((unsigned char)func->type) != 1 ? (sizetype)((long unsigned int)zend_observer_fcall_op_array_extension * 8) : (sizetype)((long unsigned int)zend_observer_fcall_internal_function_extension * 8))’ must not be NULL [-Werror=address] 341 | if ((func = zend_hash_find_ptr(EG(function_table), funcname)) && ZEND_OBSERVER_DATA(func) != NULL) { | ^~ ``` This looks similar to #13923, but I believe that the warning is right in this case: ZEND_OBSERVER_DATA(func) can not be NULL as it takes the address of ZEND_OP_ARRAY_EXTENSION(...).

« previous php.git-pulls (#29443) next »