php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76350 comparison of distinct pointer types lacks a cast
Submitted: 2018-05-17 00:31 UTC Modified: 2021-06-13 04:22 UTC
From: ailyin+php_add4_to_if_ind at anchorfree dot com Assigned: cmb (profile)
Status: No Feedback Package: Compile Warning
PHP Version: 7.1.17 OS: alpine
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: ailyin+php_add4_to_if_ind at anchorfree dot com
New email:
PHP Version: OS:

 

 [2018-05-17 00:31 UTC] 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;
      ^

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-06-01 12:36 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-06-01 12:36 UTC] cmb@php.net
`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>
 [2021-06-13 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Tue Jun 22 14:01:23 2021 UTC