[php-src] Issue #10960: Completely unnecessary compiler warnings In function ‘function_copy_ctor’
| From: | VARGA-Peter | Date: | Tue, 28 Mar 2023 11:11:08 +0000 |
| Subject: | [php-src] Issue #10960: Completely unnecessary compiler warnings In function ‘function_copy_ctor’ | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-244026@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/10960
Author: VARGA-Peter
### Description
/bin/sh /builds/php-8.2.4/libtool --silent --preserve-dup-deps --tag CC --mode=compile gcc-12
-IZend/ -I/builds/php-8.2.4/Zend/ -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 -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -c
/builds/php-8.2.4/Zend/Optimizer/zend_cfg.c -o Zend/Optimizer/zend_cfg.lo -MMD -MF
Zend/Optimizer/zend_cfg.dep -MT Zend/Optimizer/zend_cfg.lo
/builds/php-8.2.4/Zend/zend.c: In function ‘function_copy_ctor’:
/builds/php-8.2.4/Zend/zend.c:665:21: warning: array subscript ‘zend_function {aka union
_zend_function}[0]’ is partly outside array bounds of ‘unsigned char[136]’ [-Warray-bounds]
665 | func->common.arg_info = new_arg_info + 1;
| ^~
In file included from /builds/php-8.2.4/Zend/zend.h:30,
from /builds/php-8.2.4/Zend/zend.c:20:
/builds/php-8.2.4/Zend/zend_alloc.h:188:69: note: object of size 136 allocated by
‘__zend_malloc’
188 | #define pemalloc(size, persistent) ((persistent)?__zend_malloc(size):emalloc(size))
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
/builds/php-8.2.4/Zend/zend.c:632:16: note: in expansion of macro ‘pemalloc’
632 | func = pemalloc(sizeof(zend_internal_function), 1);
| ^~~~~~~~
/builds/php-8.2.4/Zend/zend.c:670:21: warning: array subscript ‘zend_function {aka union
_zend_function}[0]’ is partly outside array bounds of ‘unsigned char[136]’ [-Warray-bounds]
670 | func->common.attributes = NULL;
| ^~
/builds/php-8.2.4/Zend/zend_alloc.h:188:69: note: object of size 136 allocated by
‘__zend_malloc’
188 | #define pemalloc(size, persistent) ((persistent)?__zend_malloc(size):emalloc(size))
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
/builds/php-8.2.4/Zend/zend.c:632:16: note: in expansion of macro ‘pemalloc’
632 | func = pemalloc(sizeof(zend_internal_function), 1);
| ^~~~~~~~
### PHP Version
PHP 8.2.4
### Operating System
SLES 15.4 gcc 12