php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79431 Various compiler warnings on Big endian architecture with GCC 5.4.0
Submitted: 2020-03-30 05:52 UTC Modified: 2020-04-13 21:15 UTC
From: vibhutisawant18 at gmail dot com Assigned:
Status: Closed Package: Compile Warning
PHP Version: master-Git-2020-03-30 (Git) OS: Ubuntu 16.04
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: vibhutisawant18 at gmail dot com
New email:
PHP Version: OS:

 

 [2020-03-30 05:52 UTC] 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?



Patches

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-04-12 14:13 UTC] girgias@php.net
What version of GCC is being used?
 [2020-04-13 00:12 UTC] 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-13 08:06 UTC] vibhutisawant18 at gmail dot com
Used gcc 5.4.0
 [2020-04-13 11:37 UTC] girgias@php.net
-Summary: make command fails on Big endian arch +Summary: Various compiler warnings on Big endian architecture with GCC 5.4.0 -Status: Open +Status: Verified
 [2020-04-15 21:35 UTC] girgias@php.net
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
 [2020-04-15 21:35 UTC] girgias@php.net
-Status: Verified +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 16:01:29 2024 UTC