php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #73951 will break strict-aliasing rules [-Wstrict-aliasing]
Submitted: 2017-01-16 16:51 UTC Modified: 2020-04-16 12:33 UTC
From: spam2 at rhsoft dot net Assigned:
Status: Wont fix Package: Compile Warning
PHP Version: 7.1.1RC1 OS:
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: spam2 at rhsoft dot net
New email:
PHP Version: OS:

 

 [2017-01-16 16:51 UTC] spam2 at rhsoft dot net
Description:
------------
with "-fstrict-aliasing  -Wstrict-aliasing" you get the warning sbelow and since for -O3 strict-aliasing is default i think that should be really fixed

/home/builduser/rpmbuild/BUILD/php-7.1.1/ext/standard/crypt_sha512.c: In function 'sha512_finish_ctx':
/home/builduser/rpmbuild/BUILD/php-7.1.1/ext/standard/crypt_sha512.c:267:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
  *(uint64_t *) &ctx->buffer[bytes + pad + 8] = SWAP(ctx->total[0] << 3);
  ^
/home/builduser/rpmbuild/BUILD/php-7.1.1/ext/standard/crypt_sha512.c:268:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
  *(uint64_t *) &ctx->buffer[bytes + pad] = SWAP((ctx->total[1] << 3) |
  ^
/home/builduser/rpmbuild/BUILD/php-7.1.1/ext/standard/crypt_sha256.c: In function 'sha256_finish_ctx':
/home/builduser/rpmbuild/BUILD/php-7.1.1/ext/standard/crypt_sha256.c:240:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
  *(uint32_t *) &ctx->buffer[bytes + pad + 4] = SWAP (ctx->total[0] << 3);
  ^
/home/builduser/rpmbuild/BUILD/php-7.1.1/ext/standard/crypt_sha256.c:241:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
  *(uint32_t *) &ctx->buffer[bytes + pad] = SWAP ((ctx->total[1] << 3) |
  ^
/home/builduser/rpmbuild/BUILD/php-7.1.1/main/php_ini.c: In function 'php_init_config':
/home/builduser/rpmbuild/BUILD/php-7.1.1/main/php_ini.c:697:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
     strlcat(php_ini_scanned_files, *(char **)element->data, total_l);
     ^~~~~~~

/home/builduser/rpmbuild/BUILD/php-7.1.1/ext/hash/hash_tiger.c: In function 'TigerFinalize':
/home/builduser/rpmbuild/BUILD/php-7.1.1/ext/hash/hash_tiger.c:151:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   tiger_compress(context->passes, ((uint64_t *) context->buffer), context->state);
   ^~~~~~~~~~~~~~
/home/builduser/rpmbuild/BUILD/php-7.1.1/ext/hash/hash_tiger.c:169:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
  tiger_compress(context->passes, ((uint64_t *) context->buffer), context->state);
  ^~~~~~~~~~~~~~
/home/builduser/rpmbuild/BUILD/php-7.1.1/ext/hash/hash_tiger.c: In function 'PHP_TIGERUpdate':
/home/builduser/rpmbuild/BUILD/php-7.1.1/ext/hash/hash_tiger.c:209:4: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
    tiger_compress(context->passes, ((const uint64_t *) context->buffer), context->state);
    ^~~~~~~~~~~~~~
/home/builduser/rpmbuild/BUILD/php-7.1.1/ext/hash/hash_tiger.c:216:4: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
    tiger_compress(context->passes, ((const uint64_t *) context->buffer), context->state);
    ^~~~~~~~~~~~~~

/home/builduser/rpmbuild/BUILD/php-7.1.1/ext/iconv/iconv.c: In function '_php_iconv_strpos':
/home/builduser/rpmbuild/BUILD/php-7.1.1/ext/iconv/iconv.c:1055:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
     if (_php_iconv_memequal(buf, ndl_buf_p, sizeof(buf))) {
     ^~
/home/builduser/rpmbuild/BUILD/php-7.1.1/ext/iconv/iconv.c:1055:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
/home/builduser/rpmbuild/BUILD/php-7.1.1/ext/iconv/iconv.c:1073:7: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
       if (_php_iconv_memequal(&ZSTR_VAL(ndl_buf)[j], &ZSTR_VAL(ndl_buf)[i],
       ^~
/home/builduser/rpmbuild/BUILD/php-7.1.1/ext/iconv/iconv.c:1073:7: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
/home/builduser/rpmbuild/BUILD/php-7.1.1/ext/iconv/iconv.c:1073:7: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
/home/builduser/rpmbuild/BUILD/php-7.1.1/ext/iconv/iconv.c:1073:7: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
/home/builduser/rpmbuild/BUILD/php-7.1.1/ext/iconv/iconv.c:1083:6: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
      if (_php_iconv_memequal(buf, &ZSTR_VAL(ndl_buf)[i], sizeof(buf))) {
      ^~
/home/builduser/rpmbuild/BUILD/php-7.1.1/ext/iconv/iconv.c:1083:6: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
/home/builduser/rpmbuild/BUILD/php-7.1.1/ext/iconv/iconv.c:1083:6: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
/home/builduser/rpmbuild/BUILD/php-7.1.1/ext/iconv/iconv.c:1083:6: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
/home/builduser/rpmbuild/BUILD/php-7.1.1/ext/iconv/iconv.c:1096:4: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
    if (_php_iconv_memequal(buf, ndl_buf_p, sizeof(buf))) {
    ^~
/home/builduser/rpmbuild/BUILD/php-7.1.1/ext/iconv/iconv.c:1096:4: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
/home/builduser/rpmbuild/BUILD/php-7.1.1/ext/iconv/iconv.c:1116:6: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
      if (_php_iconv_memequal(&ZSTR_VAL(ndl_buf)[j], &ZSTR_VAL(ndl_buf)[i],
      ^~
/home/builduser/rpmbuild/BUILD/php-7.1.1/ext/iconv/iconv.c:1116:6: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
/home/builduser/rpmbuild/BUILD/php-7.1.1/ext/iconv/iconv.c:1116:6: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
/home/builduser/rpmbuild/BUILD/php-7.1.1/ext/iconv/iconv.c:1116:6: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
/home/builduser/rpmbuild/BUILD/php-7.1.1/ext/iconv/iconv.c:1126:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
     if (_php_iconv_memequal(buf, &ZSTR_VAL(ndl_buf)[i], sizeof(buf))) {
     ^~
/home/builduser/rpmbuild/BUILD/php-7.1.1/ext/iconv/iconv.c:1126:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
/home/builduser/rpmbuild/BUILD/php-7.1.1/ext/iconv/iconv.c:1126:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
/home/builduser/rpmbuild/BUILD/php-7.1.1/ext/iconv/iconv.c:1126:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]

/home/builduser/rpmbuild/BUILD/php-7.1.1/ext/phar/tar.c: In function 'phar_tar_flush':
/home/builduser/rpmbuild/BUILD/php-7.1.1/ext/phar/tar.c:1249:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   PHAR_SET_32(sigbuf, phar->sig_flags);
   ^~~~~~~~~~~



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-04-16 12:33 UTC] nikic@php.net
-Status: Open +Status: Wont fix
 [2020-04-16 12:33 UTC] nikic@php.net
We build with -Wno-strict-aliasing nowadays and do not plan to adhere strictly adhere to aliasing rules. Newer GCC versions are better about not warning about acceptable standard violations.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Oct 08 08:01:27 2024 UTC