php / php/php-src

Build failure: `cast.c: error: initialization of 'fpos_t (*)(void *, fpos_t, int)' {aka 'long long int (*)(void *, long long int, int)'} from incompatible pointer type`

Open
#15,701 13 comments 0 reactions 0 assignees View on GitHub

@devnexen is already working on this.

Since Sep 1, 2024.

  • #15702 by @devnexen — open
Bug Category: Streams OS: macOS Status: Needs Triage
Dominant language
C
Stars
40.4k
Forks
8.1k
Avg merge
2d 13h
Merged PRs (30d)
96

Description

Description

Attempt to build PHP with gcc-14 fails due to incompatible pointer types error.

Resulted in this output:

/bin/sh /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_php/php84/work/php-8.4.0beta3/libtool --silent --preserve-dup-deps --tag=CC --mode=compile ccache /opt/local/bin/gcc-mp-14 -Imain/streams/ -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_php/php84/work/php-8.4.0beta3/main/streams/ -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_php/php84/work/php-8.4.0beta3/main -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_php/php84/work/php-8.4.0beta3 -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_php/php84/work/php-8.4.0beta3/ext/date/lib -I/opt/local/include/libxml2 -I/opt/local/include -I/opt/local/include/editline -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_php/php84/work/php-8.4.0beta3/TSRM -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_php/php84/work/php-8.4.0beta3/Zend  -I/opt/local/include -D_GNU_SOURCE  -fno-common -Wstrict-prototypes -Wformat-truncation -Wlogical-op -Wduplicated-cond -Wno-clobbered -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -pipe -Os -arch ppc -ffp-contract=off -fvisibility=hidden -Wimplicit-fallthrough=1 -DZEND_SIGNALS   -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -c /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_php/php84/work/php-8.4.0beta3/main/streams/memory.c -o main/streams/memory.lo  -MMD -MF main/streams/memory.dep -MT main/streams/memory.lo
/bin/sh /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_php/php84/work/php-8.4.0beta3/libtool --silent --preserve-dup-deps --tag=CC --mode=compile ccache /opt/local/bin/gcc-mp-14 -Imain/streams/ -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_php/php84/work/php-8.4.0beta3/main/streams/ -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_php/php84/work/php-8.4.0beta3/main -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_php/php84/work/php-8.4.0beta3 -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_php/php84/work/php-8.4.0beta3/ext/date/lib -I/opt/local/include/libxml2 -I/opt/local/include -I/opt/local/include/editline -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_php/php84/work/php-8.4.0beta3/TSRM -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_php/php84/work/php-8.4.0beta3/Zend  -I/opt/local/include -D_GNU_SOURCE  -fno-common -Wstrict-prototypes -Wformat-truncation -Wlogical-op -Wduplicated-cond -Wno-clobbered -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -pipe -Os -arch ppc -ffp-contract=off -fvisibility=hidden -Wimplicit-fallthrough=1 -DZEND_SIGNALS   -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -c /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_php/php84/work/php-8.4.0beta3/main/streams/mmap.c -o main/streams/mmap.lo  -MMD -MF main/streams/mmap.dep -MT main/streams/mmap.lo
/bin/sh /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_php/php84/work/php-8.4.0beta3/libtool --silent --preserve-dup-deps --tag=CC --mode=compile ccache /opt/local/bin/gcc-mp-14 -Imain/streams/ -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_php/php84/work/php-8.4.0beta3/main/streams/ -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_php/php84/work/php-8.4.0beta3/main -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_php/php84/work/php-8.4.0beta3 -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_php/php84/work/php-8.4.0beta3/ext/date/lib -I/opt/local/include/libxml2 -I/opt/local/include -I/opt/local/include/editline -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_php/php84/work/php-8.4.0beta3/TSRM -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_php/php84/work/php-8.4.0beta3/Zend  -I/opt/local/include -D_GNU_SOURCE  -fno-common -Wstrict-prototypes -Wformat-truncation -Wlogical-op -Wduplicated-cond -Wno-clobbered -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -pipe -Os -arch ppc -ffp-contract=off -fvisibility=hidden -Wimplicit-fallthrough=1 -DZEND_SIGNALS   -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -c /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_php/php84/work/php-8.4.0beta3/main/streams/plain_wrapper.c -o main/streams/plain_wrapper.lo  -MMD -MF main/streams/plain_wrapper.dep -MT main/streams/plain_wrapper.lo
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_php/php84/work/php-8.4.0beta3/main/streams/cast.c:142:9: error: initialization of 'fpos_t (*)(void *, fpos_t,  int)' {aka 'long long int (*)(void *, long long int,  int)'} from incompatible pointer type 'fpos_t (*)(void *, zend_off_t,  int)' {aka 'long long int (*)(void *, int,  int)'} [-Wincompatible-pointer-types]
  142 |         stream_cookie_seeker, stream_cookie_closer
      |         ^~~~~~~~~~~~~~~~~~~~
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_php/php84/work/php-8.4.0beta3/main/streams/cast.c:142:9: note: (near initialization for 'stream_cookie_functions.seeker')
make: *** [main/streams/cast.lo] Error 1
make: *** Waiting for unfinished jobs....
make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_php/php84/work/php-8.4.0beta3'
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_php/php84/work/php-8.4.0beta3" && /usr/bin/make -j6 -w all 
Exit code: 2

But I expected this output instead:

Build with the current GCC version should succeed.

@ryandesign FYI

PHP Version

PHP 8.4.0beta3

Operating System

macOS 10.6

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with main/streams/cast.c at line 142 and reproduce the PHP 8.4.0beta3 build using GCC 14 on macOS 10.6. Compare the seeker callback type with the stream cookie function declaration. Done means the build completes without the incompatible-pointer-types error; linked pull request 15702 indicates work is already underway.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.