Bug #79431 [Ver->Csd]: Various compiler warnings on Big endian architecture with GCC 5.4.0

From: Date: Wed, 15 Apr 2020 21:35:28 +0000
Subject: Bug #79431 [Ver->Csd]: Various compiler warnings on Big endian architecture with GCC 5.4.0
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-226601@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: Various compiler warnings on Big endian architecture with GCC 5.4.0 -Status: Verified +Status: Closed 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: Automatic comment on behalf of Vibhuti.Sawant@ibm.com Revision: http://git.php.net/?p=php-src.git;a=commit;h=481caf17bc4e40fd437e6ed51cb4c97ed8c10e96 Log: Fix Bug #79431 Various compiler warnings on Big endian architecture with GCC 5.4.0 Previous Comments: ------------------------------------------------------------------------ [2020-04-13 21:15:03] girgias@php.net Partial fixes provided in the following commits: https://github.com/php/php-src/commit/446724bcd901428035df8cbfe27b1ccba82a85f6 https://github.com/php/php-src/commit/83004588140dbf360e92c53779715b1a2c16f286 ------------------------------------------------------------------------ [2020-04-13 08:06:17] vibhutisawant18 at gmail dot com Used gcc 5.4.0 ------------------------------------------------------------------------ [2020-04-13 00:12:00] girgias@php.net The following pull request has been associated: Patch Name: Fixed compilation warnings on big endian system On GitHub: https://github.com/php/php-src/pull/5373 Patch: https://github.com/php/php-src/pull/5373.patch ------------------------------------------------------------------------ [2020-04-12 14:13:20] girgias@php.net What version of GCC is being used? ------------------------------------------------------------------------ [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

« previous php.bugs (#226601) next »