php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79924 compile warnings with --disable-ipv6 --enable-sockets
Submitted: 2020-08-02 14:40 UTC Modified: 2020-08-02 21:04 UTC
From: santi at mola dot io Assigned:
Status: Closed Package: Compile Warning
PHP Version: Supported versions 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: santi at mola dot io
New email:
PHP Version: OS:

 

 [2020-08-02 14:40 UTC] santi at mola dot io
Description:
------------
multiple compile warnings with --disable-ipv6 --enable-sockets.

Marked version PHP 8, but some warnings are probably present in most previous releases too.

Test script:
---------------
#!/bin/sh
set -ex
make clean || true
./buildconf -f
./configure --disable-all --disable-phpdbg --disable-ipv6 --enable-sockets --enable-werror
make -j $(nproc)

Actual result:
--------------
[...]
      |             ^~~~~~~~~~~~~~~~~~~~~~~
/__w/php-src/php-src/ext/sockets/conversions.c:505:13: error: 'to_zval_read_uint32' defined but not used [-Werror=unused-function]
  505 | static void to_zval_read_uint32(const char *data, zval *zv, res_context *ctx)
      |             ^~~~~~~~~~~~~~~~~~~
/__w/php-src/php-src/ext/sockets/conversions.c:491:13: error: 'to_zval_read_unsigned' defined but not used [-Werror=unused-function]
  491 | static void to_zval_read_unsigned(const char *data, zval *zv, res_context *ctx)
      |             ^~~~~~~~~~~~~~~~~~~~~
/bin/bash /__w/php-src/php-src/libtool --silent --preserve-dup-deps --mode=compile cc -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -Iext/sockets/ -I/__w/php-src/php-src/ext/sockets/ -DPHP_ATOM_INC -I/__w/php-src/php-src/include -I/__w/php-src/php-src/main -I/__w/php-src/php-src -I/__w/php-src/php-src/ext/date/lib -I/usr/include/libxml2 -I/usr/include/x86_64-linux-gnu -I/usr/include/enchant -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/libpng16 -I/usr/include/freetype2 -I/__w/php-src/php-src/ext/mbstring/libmbfl -I/__w/php-src/php-src/ext/mbstring/libmbfl/mbfl -I/usr/include/postgresql -I/usr/include/pspell -I/usr/include/tidy -I/__w/php-src/php-src/TSRM -I/__w/php-src/php-src/Zend    -I/usr/include -g -O2 -fvisibility=hidden -Wall -Wextra -Wno-strict-aliasing -Wno-implicit-fallthrough -Wno-unused-parameter -Wno-sign-compare -Wno-clobbered -DZEND_SIGNALS -Werror   -c /__w/php-src/php-src/ext/sockets/sockaddr_conv.c -o ext/sockets/sockaddr_conv.lo 
/__w/php-src/php-src/ext/sockets/conversions.c: In function 'from_zval_write_controllen':
/__w/php-src/php-src/ext/sockets/conversions.c:1116:24: error: 'len' may be used uninitialized in this function [-Werror=maybe-uninitialized]
 1116 |  msghdr->msg_control = accounted_emalloc(len, ctx);
      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make: *** [Makefile:1685: ext/sockets/conversions.lo] Error 1
[...]

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-08-02 21:04 UTC] carusogabriel@php.net
-Status: Open +Status: Verified -Operating System: Linux +Operating System: -PHP Version: 8.0.0alpha3 +PHP Version: Supported versions
 [2020-08-02 21:04 UTC] carusogabriel@php.net
With the provided `Test script`, it's confirmed that this happens in PHP 7.3 and PHP 7.4 as well.

These functions should be moved under a flag check for IPV6 (https://github.com/php/php-src/blob/1e0bc6e30f/ext/sockets/conversions.c#L589-L642)
 [2020-08-03 12:57 UTC] nikic@php.net
Automatic comment on behalf of nikita.ppv@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=8b4da1774f2e8ba74579675460c37e0ebe723fdc
Log: Fix bug #79924
 [2020-08-03 12:57 UTC] nikic@php.net
-Status: Verified +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Nov 08 15:01:30 2024 UTC