Skip to content

Fix -Werror compile error in zend_dval_to_lval_cap()#22196

Merged
ndossche merged 1 commit into
php:PHP-8.5from
ndossche:fix-werror-zend_dval_to_lval_cap
Jun 1, 2026
Merged

Fix -Werror compile error in zend_dval_to_lval_cap()#22196
ndossche merged 1 commit into
php:PHP-8.5from
ndossche:fix-werror-zend_dval_to_lval_cap

Conversation

@ndossche
Copy link
Copy Markdown
Member

This made imagick CI fail on PHP 8.5:

/usr/include/php/20250925/Zend/zend_operators.h: In function 'zend_dval_to_lval_cap':
/usr/include/php/20250925/Zend/zend_operators.h:149:88: error: unused parameter 's' [-Werror=unused-parameter]
  149 | static zend_always_inline zend_long zend_dval_to_lval_cap(double d, const zend_string *s)
      |                                                                     ~~~~~~~~~~~~~~~~~~~^
cc1: all warnings being treated as errors

This makes imagick CI fail on PHP 8.5:
```
/usr/include/php/20250925/Zend/zend_operators.h: In function 'zend_dval_to_lval_cap':
/usr/include/php/20250925/Zend/zend_operators.h:149:88: error: unused parameter 's' [-Werror=unused-parameter]
  149 | static zend_always_inline zend_long zend_dval_to_lval_cap(double d, const zend_string *s)
      |                                                                     ~~~~~~~~~~~~~~~~~~~^
cc1: all warnings being treated as errors
```
Copy link
Copy Markdown
Member

@iluuu1994 iluuu1994 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks. For context, this was added in GH-19760 as part of https://wiki.php.net/rfc/warnings-php-8-5#casting_out_of_range_floats_to_int, but then removed in GH-20746.

@ndossche ndossche merged commit 4c8dabf into php:PHP-8.5 Jun 1, 2026
18 checks passed
ndossche added a commit that referenced this pull request Jun 1, 2026
* PHP-8.5:
  Fix -Werror compile error in `zend_dval_to_lval_cap()` (#22196)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants