Bug #79431 [Opn]: make command fails on Big endian arch
| From: | girgias@php.net | Date: | Sun, 12 Apr 2020 14:13:20 +0000 |
| Subject: | Bug #79431 [Opn]: make command fails on Big endian arch | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-226543@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=79431&edit=1
ID: 79431
Updated by: girgias@php.net
Reported by: vibhutisawant18 at gmail dot com
Summary: make command fails on Big endian arch
Status: Open
Type: Bug
Package: Compile Warning
Operating System: Ubuntu 16.04
PHP Version: master-Git-2020-03-30 (Git)
Block user comment: N
Private report: N
New Comment:
What version of GCC is being used?
Previous Comments:
------------------------------------------------------------------------
[2020-03-30 05:52:42] vibhutisawant18 at gmail dot com
Description:
------------
With --enable-werror flag enabled in configure command, following warnings were observed on big
endian arch while running the make command:
1) /root/php/php-src/ext/ffi/ffi_parser.c: In function 'get_skip_sym':
/root/php/php-src/ext/ffi/ffi_parser.c:1664:10: error: 'accept_pos' may be used
uninitialized in this function [-Werror=maybe-uninitialized]
yy_pos = accept_pos;
2)/root/php/php-src/ext/hash/hash_sha3.c: In function 'store64':
/root/php/php-src/ext/hash/hash_sha3.c:54:4: error: array subscript has type 'char'
[-Werror=char-subscripts]
x[i] = val & 0xFF;
^
/root/php/php-src/ext/hash/hash_sha3.c: In function 'xor64':
/root/php/php-src/ext/hash/hash_sha3.c:61:4: error: array subscript has type 'char'
[-Werror=char-subscripts]
x[i] ^= val & 0xFF;
^
3) /root/php/php-src/ext/intl/collator/collator_is_numeric.c: In function
'collator_u_strtod':
/root/php/php-src/Zend/zend_portability.h:365:10: error: 'use_heap' may be used
uninitialized in this function [-Werror=maybe-uninitialized]
do { if (UNEXPECTED(use_heap)) efree(p); } while (0)
^
/root/php/php-src/ext/intl/collator/collator_is_numeric.c:72:15: note: 'use_heap' was
declared here
ALLOCA_FLAG(use_heap);
^
/root/php/php-src/Zend/zend_portability.h:357:12: note: in definition of macro
'ALLOCA_FLAG'
zend_bool name;
4)/root/php/php-src/ext/pdo/pdo_stmt.c:753:53: error: missing braces around initializer
[-Werror=missing-braces]
zval grp_val, *pgrp, retval, old_ctor_args = {{0}, {{0}}, {0}};
^
/root/php/php-src/ext/pdo/pdo_stmt.c:753:53: note: (near initialization for
'old_ctor_args.u1')
/root/php/php-src/ext/pdo/pdo_stmt.c:753:47: error: missing braces around initializer
[-Werror=missing-braces]
zval grp_val, *pgrp, retval, old_ctor_args = {{0}, {{0}}, {0}};
^
5)/root/php/php-src/Zend/zend_execute_API.c:49:62: error: missing braces around initializer
[-Werror=missing-braces]
ZEND_API const zend_fcall_info empty_fcall_info = { 0, {{0}, {{0}}, {0}}, NULL, NULL, NULL, 0, 0 };
^
/root/php/php-src/Zend/zend_execute_API.c:49:62: note: (near initialization for
'empty_fcall_info.function_name.u1')
/root/php/php-src/Zend/zend_execute_API.c:49:56: error: missing braces around initializer
[-Werror=missing-braces]
ZEND_API const zend_fcall_info empty_fcall_info = { 0, {{0}, {{0}}, {0}}, NULL, NULL, NULL, 0, 0 };
^
/root/php/php-src/Zend/zend_execute_API.c:49:56: note: (near initialization for
'empty_fcall_info.function_name')
/root/php/php-src/Zend/zend_execute_API.c:49:51: error: missing braces around initializer
[-Werror=missing-braces]
ZEND_API const zend_fcall_info empty_fcall_info = { 0, {{0}, {{0}}, {0}}, NULL, NULL, NULL, 0, 0 };
All of the above warnings are fixed by making suggested changes in the respective files
However no such warnings are observed on amd64 arch.
Also by adding the fixes , the build completes successfully on Little Endian arch as well.
Added a patch file along with this bug.
How can we get rid of this warnings?
Are there any x86 specific flags used during compilation?
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=79431&edit=1