Bug #76350 [Opn->Fbk]: comparison of distinct pointer types lacks a cast
| From: | cmb@php.net | Date: | Tue, 01 Jun 2021 12:36:23 +0000 |
| Subject: | Bug #76350 [Opn->Fbk]: comparison of distinct pointer types lacks a cast | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-234139@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=76350&edit=1
ID: 76350
Updated by: cmb@php.net
Reported by: ailyin+php_add4_to_if_ind at anchorfree dot com
Summary: comparison of distinct pointer types lacks a cast
-Status: Open
+Status: Feedback
Type: Bug
Package: Compile Warning
Operating System: alpine
PHP Version: 7.1.17
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
p is a char* and if_conf.ifc_buf is also supposed to be a
char*. Which type does it have in musl libc?
[1] <https://man7.org/linux/man-pages/man7/netdevice.7.html>
Previous Comments:
------------------------------------------------------------------------
[2018-05-17 00:31:48] ailyin+php_add4_to_if_ind at anchorfree dot com
Description:
------------
/usr/src/php/ext/sockets/multicast.c: In function 'php_add4_to_if_index':
/usr/src/php/ext/sockets/multicast.c:793:6: warning: comparison of distinct pointer types lacks a
cast
p < if_conf.ifc_buf + if_conf.ifc_len;
^
Test script:
---------------
FROM php:7.1-fpm-alpine AS build-env
RUN docker-php-source extract
RUN echo '@edge-main http://dl-cdn.alpinelinux.org/alpine/edge/main'
>> /etc/apk/repositories
RUN echo '@edge-community http://dl-cdn.alpinelinux.org/alpine/edge/community'
>> /etc/apk/repositories
RUN echo '@edge-testing http://dl-cdn.alpinelinux.org/alpine/edge/testing'
>> /etc/apk/repositories
RUN apk update
RUN apk add --upgrade apk-tools@edge-main
RUN apk add \
coreutils \
postgresql-dev@edge-main \
libmcrypt-dev \
bzip2-dev \
libpng-dev \
libxslt-dev \
gettext-dev \
autoconf \
g++ \
make \
cmake \
geoip-dev \
libmemcached-dev \
cyrus-sasl-dev \
pcre-dev \
git \
file \
freetype-dev \
libjpeg-turbo-dev \
re2c \
libressl-dev@edge-main \
rabbitmq-c-dev@edge-main
RUN docker-php-ext-configure \
gd --with-freetype-dir=/usr/lib --with-jpeg-dir=/usr/lib --with-png-dir=/usr/lib
RUN docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) \
mcrypt \
mysqli \
bz2 \
opcache \
calendar \
gd \
pcntl \
xsl \
soap \
shmop \
sysvmsg \
sysvsem \
sysvshm \
sockets \
pdo_mysql \
pdo_pgsql \
pgsql \
wddx
Expected result:
----------------
No warning message in the build log.
Actual result:
--------------
/usr/src/php/ext/sockets/multicast.c: In function 'php_add4_to_if_index':
/usr/src/php/ext/sockets/multicast.c:793:6: warning: comparison of distinct pointer types lacks a
cast
p < if_conf.ifc_buf + if_conf.ifc_len;
^
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=76350&edit=1