Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 942283 - dev-lang/php-8.1.30 fails to compile with gcc-14 if USE=pdo and USE=odbc
Summary: dev-lang/php-8.1.30 fails to compile with gcc-14 if USE=pdo and USE=odbc
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: PHP Bugs
URL:
Whiteboard:
Keywords: PMASKED
Depends on:
Blocks: c99-porting gcc-14-stable
  Show dependency tree
 
Reported: 2024-10-26 12:16 UTC by Attila Tóth
Modified: 2024-11-13 19:38 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
php-8.1.30-pgo-odbc-gcc14.patch (php-8.1.30-pgo-odbc-gcc14.patch,1.13 KB, patch)
2024-10-26 12:25 UTC, Attila Tóth
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Attila Tóth 2024-10-26 12:16:26 UTC
/var/tmp/portage/dev-lang/php-8.1.30/work/sapis-build/cli/ext/pdo_odbc/odbc_driver.c: In function ‘pdo_odbc_error’:
/var/tmp/portage/dev-lang/php-8.1.30/work/sapis-build/cli/ext/pdo_odbc/odbc_driver.c:86:79: error: passing argument 5 of ‘SQLGetDiagRec’ from incompatible pointer type [-Wincompatible-pointer-types]
   86 |         rc = SQLGetDiagRec(htype, eh, recno++, (SQLCHAR *) einfo->last_state, &einfo->last_error,
      |                                                                               ^~~~~~~~~~~~~~~~~~
      |                                                                               |
      |                                                                               SDWORD * {aka long int *}
In file included from /usr/include/iodbc/sqlext.h:82,
                 from /usr/include/iodbc/sqlucode.h:81,
                 from /var/tmp/portage/dev-lang/php-8.1.30/work/sapis-build/cli/ext/pdo_odbc/php_pdo_odbc_int.h:51,
                 from /var/tmp/portage/dev-lang/php-8.1.30/work/sapis-build/cli/ext/pdo_odbc/odbc_driver.c:27:
/usr/include/iodbc/sql.h:1006:27: note: expected ‘SQLINTEGER *’ {aka ‘int *’} but argument is of type ‘SDWORD *’ {aka ‘long int *’}
 1006 |     SQLINTEGER          * NativeError,
      |     ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
/var/tmp/portage/dev-lang/php-8.1.30/work/sapis-build/cli/ext/pdo_odbc/odbc_driver.c:101:104: warning: format ‘%d’ expects argument of type ‘int’, but argument 6 has type ‘SDWORD’ {aka ‘long int’} [-Wformat=]
  101 |                 zend_throw_exception_ex(php_pdo_get_exception(), einfo->last_error, "SQLSTATE[%s] %s: %d %s",
      |                                                                                                       ~^
      |                                                                                                        |
      |                                                                                                        int
      |                                                                                                       %ld
  102 |                                 *pdo_err, what, einfo->last_error, einfo->last_err_msg);
      |                                                 ~~~~~~~~~~~~~~~~~
      |                                                      |
      |                                                      SDWORD {aka long int}


Reproducible: Always
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-10-26 12:20:37 UTC
Please always include the full build.log.
Comment 2 Attila Tóth 2024-10-26 12:25:11 UTC
Created attachment 906851 [details, diff]
php-8.1.30-pgo-odbc-gcc14.patch

Works for me
Comment 3 Michael Orlitzky gentoo-dev 2024-10-27 21:12:18 UTC
There was a real size mismatch between these two types that can't be fixed with a cast: https://github.com/php/php-src/issues/14367

8.1.x is EOL upstream unless you can convince them that this is a security issue.  You'll have to upgrade to 8.2.x or, preferably, 8.3.x. I've been planning to mask 8.1.x but other things keep coming up.
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-10-27 21:15:47 UTC
Yes, all casts should be done as a last-resort after real analysis, not just slapping it on.
Comment 5 Andreas K. Hüttel archtester gentoo-dev 2024-11-01 17:12:45 UTC
(In reply to Michael Orlitzky from comment #3)
> There was a real size mismatch between these two types that can't be fixed
> with a cast: https://github.com/php/php-src/issues/14367
> 
> 8.1.x is EOL upstream unless you can convince them that this is a security
> issue.  You'll have to upgrade to 8.2.x or, preferably, 8.3.x. I've been
> planning to mask 8.1.x but other things keep coming up.

It's still there, so re-opening for the moment.
Comment 6 Michael Orlitzky gentoo-dev 2024-11-01 17:35:23 UTC
(In reply to Andreas K. Hüttel from comment #5)
> (In reply to Michael Orlitzky from comment #3)
> > There was a real size mismatch between these two types that can't be fixed
> > with a cast: https://github.com/php/php-src/issues/14367
> > 
> > 8.1.x is EOL upstream unless you can convince them that this is a security
> > issue.  You'll have to upgrade to 8.2.x or, preferably, 8.3.x. I've been
> > planning to mask 8.1.x but other things keep coming up.
> 
> It's still there, so re-opening for the moment.

There's a newer stable series of PHP already so this shouldn't block GCC stabilization IMO. Say: fixed in 8.2.24 (stable).