Skip to content

Fix incompatible pointer types (32-bit) + fix for PHP 8.5 - #4

Merged
MirKml merged 2 commits into
php:masterfrom
remicollet:issue-pointers
Aug 16, 2026
Merged

MirKml merged 2 commits into
php:masterfrom
remicollet:issue-pointers

Conversation

@remicollet

Copy link
Copy Markdown
Member

This is a warning, but a real problem
Become an error on Fedora with with GCC 14

/builddir/build/BUILD/php-pecl-rrd-2.0.3/NTS/rrd.c: In function 'zif_rrd_fetch':
/builddir/build/BUILD/php-pecl-rrd-2.0.3/NTS/rrd.c:79:70: error: passing argument 5 of 'rrd_fetch' from incompatible pointer type [-Wincompatible-pointer-types]
   79 |         if (rrd_fetch(argv->count - 1, &argv->args[1], &start, &end, &step, &ds_cnt,
      |                                                                      ^~~~~
      |                                                                      |
      |                                                                      zend_ulong * {aka unsigned int *}
In file included from /builddir/build/BUILD/php-pecl-rrd-2.0.3/NTS/rrd.c:19:
/usr/include/rrd.h:201:5: note: expected 'long unsigned int *' but argument is of type 'zend_ulong *' {aka 'unsigned int *'}
  201 |     unsigned long *,
      |     ^~~~~~~~~~~~~~~
/builddir/build/BUILD/php-pecl-rrd-2.0.3/NTS/rrd.c:79:77: error: passing argument 6 of 'rrd_fetch' from incompatible pointer type [-Wincompatible-pointer-types]
   79 |         if (rrd_fetch(argv->count - 1, &argv->args[1], &start, &end, &step, &ds_cnt,
      |                                                                             ^~~~~~~
      |                                                                             |
      |                                                                             zend_ulong * {aka unsigned int *}
/usr/include/rrd.h:202:5: note: expected 'long unsigned int *' but argument is of type 'zend_ulong *' {aka 'unsigned int *'}
  202 |     unsigned long *,
      |     ^~~~~~~~~~~~~~~
/builddir/build/BUILD/php-pecl-rrd-2.0.3/NTS/rrd.c: In function 'zif_rrd_xport':
/builddir/build/BUILD/php-pecl-rrd-2.0.3/NTS/rrd.c:418:77: error: passing argument 6 of 'rrd_xport' from incompatible pointer type [-Wincompatible-pointer-types]
  418 |         if (rrd_xport(argv->count-1, &argv->args[1], &xxsize, &start, &end, &step,
      |                                                                             ^~~~~
      |                                                                             |
      |                                                                             zend_ulong * {aka unsigned int *}
/usr/include/rrd.h:236:5: note: expected 'long unsigned int *' but argument is of type 'zend_ulong *' {aka 'unsigned int *'}
  236 |     unsigned long *,
      |     ^~~~~~~~~~~~~~~
/builddir/build/BUILD/php-pecl-rrd-2.0.3/NTS/rrd.c:419:17: error: passing argument 7 of 'rrd_xport' from incompatible pointer type [-Wincompatible-pointer-types]
  419 |                 &outvar_count, &legend_v, &data) == -1) {
      |                 ^~~~~~~~~~~~~
      |                 |
      |                 zend_ulong * {aka unsigned int *}
/usr/include/rrd.h:237:5: note: expected 'long unsigned int *' but argument is of type 'zend_ulong *' {aka 'unsigned int *'}
  237 |     unsigned long *,
      |     ^~~~~~~~~~~~~~~

@remicollet

Copy link
Copy Markdown
Member Author

Second commit is for PHP 8.5

@remicollet remicollet mentioned this pull request Oct 7, 2025
@remicollet remicollet changed the title Fix incompatible pointer types (32-bit) Fix incompatible pointer types (32-bit) + fix for PHP 8.5 Oct 7, 2025
@GregOriol

Copy link
Copy Markdown

Thanks @remicollet just got to this by upgrading to php 8.5, can confirm patch works and rrd is fine after that

@COhsrt

COhsrt commented Aug 16, 2026

Copy link
Copy Markdown

@MirKml is it possible to have this merged and the version bumped/released?

@MirKml
MirKml merged commit 451613d into php:master Aug 16, 2026
@MirKml

MirKml commented Aug 16, 2026

Copy link
Copy Markdown
Collaborator

Merged.

@remicollet or @CMB
Do you have all permissions for bumping a publishing new versions? Let me know, if I can enable, add these permissions for you.
I have some troubles with setup php internals dev tools.

MirKml pushed a commit that referenced this pull request Aug 20, 2026
Bumps package.xml and PHP_RRD_VERSION to 2.0.4 so the PHP 8.4/8.5 build
fix from #4 can ship; the last release (2.0.3) predates it. Also corrects
the 'librdd' typo in the config.m4 probe message.

Validated in Docker: pecl package + pecl install produce a working 2.0.4
that reports its version correctly and passes the test suite on 8.1-8.5.

Signed-off-by: Thomas Vincent <[email protected]>
@MirKml

MirKml commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

I saw, that there is new extension tools - pie - which replaced pecl.
I don't have much time to implement it.
If @remicollet or someone else has time, you can implement it.
I think it helps to remove old pecl/pear publish stuff at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants