[php-src] Issue #10961: Completely unnecessary compiler warnings In function ‘zend_register_functions’

From: Date: Tue, 28 Mar 2023 11:11:55 +0000
Subject: [php-src] Issue #10961: Completely unnecessary compiler warnings In function ‘zend_register_functions’
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-244027@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/10961 Author: VARGA-Peter ### Description /bin/sh /builds/php-8.2.4/libtool --silent --preserve-dup-deps --tag CC --mode=compile gcc-12 -Isapi/phpdbg/ -I/builds/php-8.2.4/sapi/phpdbg/ -I/builds/php-8.2.4/include -I/builds/php-8.2.4/main -I/builds/php-8.2.4 -I/builds/php-8.2.4/ext/date/lib -I/usr/include/libxml2 -I/usr/include/libpng16 -I/builds/php-8.2.4/ext/mbstring/libmbfl -I/builds/php-8.2.4/ext/mbstring/libmbfl/mbfl -I/builds/php-8.2.4/TSRM -I/builds/php-8.2.4/Zend -D_GNU_SOURCE -D_REENTRANT -pthread -fno-common -Wformat-truncation -Wlogical-op -Wduplicated-cond -Wno-clobbered -Wall -Wextra -Wno-strict-aliasing -Wno-unused-parameter -Wno-sign-compare -g -O2 -fvisibility=hidden -pthread -Wimplicit-fallthrough=1 -DZTS -DZEND_SIGNALS -D_GNU_SOURCE -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -c /builds/php-8.2.4/sapi/phpdbg/phpdbg_out.c -o sapi/phpdbg/phpdbg_out.lo -MMD -MF sapi/phpdbg/phpdbg_out.dep -MT sapi/phpdbg/phpdbg_out.lo /builds/php-8.2.4/Zend/zend_API.c: In function ‘zend_register_functions’: /builds/php-8.2.4/Zend/zend_API.c:2821:49: warning: array subscript ‘zend_function {aka union _zend_function}[0]’ is partly outside array bounds of ‘unsigned char[136]’ [-Warray-bounds] 2821 | uint32_t num_args = reg_function->common.num_args; | ^~ /builds/php-8.2.4/Zend/zend_API.c:2811:32: note: object of size 136 allocated by ‘malloc’ 2811 | reg_function = malloc(sizeof(zend_internal_function)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /builds/php-8.2.4/Zend/zend_API.c:2822:33: warning: array subscript ‘zend_function {aka union _zend_function}[0]’ is partly outside array bounds of ‘unsigned char[136]’ [-Warray-bounds] 2822 | if (reg_function->common.fn_flags & ZEND_ACC_VARIADIC) { | ^~ /builds/php-8.2.4/Zend/zend_API.c:2811:32: note: object of size 136 allocated by ‘malloc’ 2811 | reg_function = malloc(sizeof(zend_internal_function)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /builds/php-8.2.4/Zend/zend_API.c:2827:33: warning: array subscript ‘zend_function {aka union _zend_function}[0]’ is partly outside array bounds of ‘unsigned char[136]’ [-Warray-bounds] 2827 | if (reg_function->common.arg_info && num_args) { | ^~ /builds/php-8.2.4/Zend/zend_API.c:2811:32: note: object of size 136 allocated by ‘malloc’ 2811 | reg_function = malloc(sizeof(zend_internal_function)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /builds/php-8.2.4/Zend/zend_API.c:2833:49: warning: array subscript ‘zend_function {aka union _zend_function}[0]’ is partly outside array bounds of ‘unsigned char[136]’ [-Warray-bounds] 2833 | reg_function->common.fn_flags |= ZEND_ACC_HAS_TYPE_HINTS; | ^~ /builds/php-8.2.4/Zend/zend_API.c:2811:32: note: object of size 136 allocated by ‘malloc’ 2811 | reg_function = malloc(sizeof(zend_internal_function)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /builds/php-8.2.4/Zend/zend_API.c:2833:49: warning: array subscript ‘zend_function {aka union _zend_function}[0]’ is partly outside array bounds of ‘unsigned char[136]’ [-Warray-bounds] 2833 | reg_function->common.fn_flags |= ZEND_ACC_HAS_TYPE_HINTS; | ^~ /builds/php-8.2.4/Zend/zend_API.c:2811:32: note: object of size 136 allocated by ‘malloc’ 2811 | reg_function = malloc(sizeof(zend_internal_function)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /builds/php-8.2.4/Zend/zend_API.c:2849:34: warning: array subscript ‘zend_function {aka union _zend_function}[0]’ is partly outside array bounds of ‘unsigned char[136]’ [-Warray-bounds] 2849 | (reg_function->common.fn_flags & (ZEND_ACC_HAS_RETURN_TYPE|ZEND_ACC_HAS_TYPE_HINTS))) { | ^~ /builds/php-8.2.4/Zend/zend_API.c:2811:32: note: object of size 136 allocated by ‘malloc’ 2811 | reg_function = malloc(sizeof(zend_internal_function)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /builds/php-8.2.4/Zend/zend_API.c:2859:37: warning: array subscript ‘zend_function {aka union _zend_function}[0]’ is partly outside array bounds of ‘unsigned char[136]’ [-Warray-bounds] 2859 | reg_function->common.arg_info = new_arg_info + 1; | ^~ /builds/php-8.2.4/Zend/zend_API.c:2811:32: note: object of size 136 allocated by ‘malloc’ 2811 | reg_function = malloc(sizeof(zend_internal_function)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ### PHP Version PHP 8.2.4 ### Operating System SLES 15.4 gcc 12

« previous php.bugs (#244027) next »