m6w6 / ext-http

Extended HTTP Support
BSD 2-Clause "Simplified" License
79 stars 22 forks source link

Fix incompatible pointer types (32-bit) #134

Closed remicollet closed 9 months ago

remicollet commented 9 months ago

With GCC 14 (Fedora 40) [-Wincompatible-pointer-types] becomes a error (and is indeed one)

See https://kojipkgs.fedoraproject.org//work/tasks/9963/112369963/build.log


/builddir/build/BUILD/php-pecl-http-4.2.4/pecl_http-4.2.4/src/php_http_url.c: In function 'php_http_url_from_env':
/builddir/build/BUILD/php-pecl-http-4.2.4/pecl_http-4.2.4/src/php_http_url.c:110:89: error: passing argument 3 of 'is_numeric_string' from incompatible pointer type [-Wincompatible-pointer-types]
  110 |         if (zport && IS_LONG == is_numeric_string(Z_STRVAL_P(zport), Z_STRLEN_P(zport), &port, NULL, 0)) {
      |                                                                                         ^~~~~
      |                                                                                         |
      |                                                                                         long int *
In file included from /usr/include/php/Zend/zend.h:417,
                 from /usr/include/php/main/php.h:31,
                 from /builddir/build/BUILD/php-pecl-http-4.2.4/pecl_http-4.2.4/src/php_http_api.h:31,
                 from /builddir/build/BUILD/php-pecl-http-4.2.4/pecl_http-4.2.4/src/php_http_url.c:13:
/usr/include/php/Zend/zend_operators.h:157:96: note: expected 'zend_long *' {aka 'int *'} but argument is of type 'long int *'
  157 | static zend_always_inline uint8_t is_numeric_string(const char *str, size_t length, zend_long *lval, double *dval, bool allow_errors) {

```    |                                                                                     ~~~~~~~~~~~^~~~
codecov[bot] commented 9 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (ff2148e) 85.65% compared to head (88e279d) 85.62%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #134 +/- ## ========================================== - Coverage 85.65% 85.62% -0.03% ========================================== Files 42 42 Lines 9263 9262 -1 ========================================== - Hits 7934 7931 -3 - Misses 1329 1331 +2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

remicollet commented 9 months ago

Build with this patch applied https://koji.fedoraproject.org/koji/taskinfo?taskID=112553589