php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80876 Compile errors/warnings with unixODBC
Submitted: 2021-03-17 12:05 UTC Modified: 2021-03-17 15:37 UTC
From: sergiopaternoster73 at gmail dot com Assigned: nikic (profile)
Status: Closed Package: PDO ODBC
PHP Version: 8.0.3 OS: Ubuntu 18.04 Server
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: sergiopaternoster73 at gmail dot com
New email:
PHP Version: OS:

 

 [2021-03-17 12:05 UTC] sergiopaternoster73 at gmail dot com
Description:
------------
Simple configure (and unixODBC 2.3.9 previously compiled in /usr/local).
The compile ends eventually but I have some instability in using ODBC.

sudo ./configure --prefix=/usr/local/php/8.0.3 \
--disable-cgi \
--enable-debug \
--disable-opcache \
--enable-mbstring \
--with-pdo_odbc=unixODBC,/usr/local \
--with-unixODBC=/usr/local \
--with-iconv  \
--without-pdo-sqlite \
--disable-phar


It generates a list of warnings (which I think are related to my ODBC/Unicode issues on php8):


/bin/bash /home/edsradmin/software/php/php-8.0.3/libtool --silent --preserve-dup-deps --mode=compile cc -Iext/pdo_odbc/ -I/home/edsradmin/software/php/php-8.0.3/ext/pdo_odbc/ -I/home/edsradmin/software/php/php-8.0.3/include -I/home/edsradmin/software/php/php-8.0.3/main -I/home/edsradmin/software/php/php-8.0.3 -I/home/edsradmin/software/php/php-8.0.3/ext/date/lib -I/usr/include/libxml2 -I/home/edsradmin/software/php/php-8.0.3/ext/mbstring/libmbfl -I/home/edsradmin/software/php/php-8.0.3/ext/mbstring/libmbfl/mbfl -I/home/edsradmin/software/php/php-8.0.3/TSRM -I/home/edsradmin/software/php/php-8.0.3/Zend    -Wno-clobbered -Wall -Wextra -Wno-strict-aliasing -Wno-implicit-fallthrough -Wno-unused-parameter -Wno-sign-compare -g -fvisibility=hidden -O0 -DZEND_SIGNALS   -I/home/edsradmin/software/php/php-8.0.3/ext  -I/usr/local/include -DPDO_ODBC_TYPE=\"unixODBC\" -c /home/edsradmin/software/php/php-8.0.3/ext/pdo_odbc/odbc_driver.c -o ext/pdo_odbc/odbc_driver.lo
/home/edsradmin/software/php/php-8.0.3/ext/pdo_odbc/odbc_driver.c: In function ‘pdo_odbc_fetch_error_func’:
/home/edsradmin/software/php/php-8.0.3/ext/pdo_odbc/odbc_driver.c:42:36: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘SDWORD {aka int}’ [-Wformat=]
  message = strpprintf(0, "%s (%s[%ld] at %s:%d)",
                                  ~~^
                                  %d
/home/edsradmin/software/php/php-8.0.3/ext/pdo_odbc/odbc_driver.c:44:18:
     einfo->what, einfo->last_error,
                  ~~~~~~~~~~~~~~~~~
/home/edsradmin/software/php/php-8.0.3/ext/pdo_odbc/odbc_driver.c: In function ‘pdo_odbc_error’:
/home/edsradmin/software/php/php-8.0.3/ext/pdo_odbc/odbc_driver.c:88:41: warning: pointer targets in passing argument 4 of ‘SQLGetDiagRec’ differ in signedness [-Wpointer-sign]
  rc = SQLGetDiagRec(htype, eh, recno++, einfo->last_state, &einfo->last_error,
                                         ^~~~~
In file included from /usr/local/include/sqlext.h:43:0,
                 from /usr/local/include/sqlucode.h:784,
                 from /home/edsradmin/software/php/php-8.0.3/ext/pdo_odbc/php_pdo_odbc_int.h:51,
                 from /home/edsradmin/software/php/php-8.0.3/ext/pdo_odbc/odbc_driver.c:27:
/usr/local/include/sql.h:726:24: note: expected ‘SQLCHAR * {aka unsigned char *}’ but argument is of type ‘char *’
     SQLRETURN  SQL_API SQLGetDiagRec(SQLSMALLINT HandleType, SQLHANDLE Handle,
                        ^~~~~~~~~~~~~
/home/edsradmin/software/php/php-8.0.3/ext/pdo_odbc/odbc_driver.c:89:4: warning: pointer targets in passing argument 6 of ‘SQLGetDiagRec’ differ in signedness [-Wpointer-sign]
    einfo->last_err_msg, sizeof(einfo->last_err_msg)-1, &errmsgsize);
    ^~~~~

Expected result:
----------------
No errors


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-03-17 12:58 UTC] nikic@php.net
Does cherry-picking https://github.com/php/php-src/commit/aa58db723221ec891d4432621003bfa55dc15edf fix the warnings?
 [2021-03-17 13:41 UTC] sergiopaternoster73 at gmail dot com
Unfortunately not. Now I also see a problem with pdo_odbc.c, is there any patch for that as well?

/bin/bash /home/edsradmin/software/php/php-8.0.3/libtool --silent --preserve-dup-deps --mode=compile cc -Iext/pdo_odbc/ -I/home/edsradmin/software/php/php-8.0.3/ext/pdo_odbc/ -I/home/edsradmin/software/php/php-8.0.3/include -I/home/edsradmin/software/php/php-8.0.3/main -I/home/edsradmin/software/php/php-8.0.3 -I/home/edsradmin/software/php/php-8.0.3/ext/date/lib -I/usr/include/libxml2 -I/home/edsradmin/software/php/php-8.0.3/ext/mbstring/libmbfl -I/home/edsradmin/software/php/php-8.0.3/ext/mbstring/libmbfl/mbfl -I/home/edsradmin/software/php/php-8.0.3/TSRM -I/home/edsradmin/software/php/php-8.0.3/Zend    -Wno-clobbered -Wall -Wextra -Wno-strict-aliasing -Wno-implicit-fallthrough -Wno-unused-parameter -Wno-sign-compare -g -fvisibility=hidden -O0 -DZEND_SIGNALS   -I/home/edsradmin/software/php/php-8.0.3/ext  -I/usr/local/include -DPDO_ODBC_TYPE=\"unixODBC\" -c /home/edsradmin/software/php/php-8.0.3/ext/pdo_odbc/pdo_odbc.c -o ext/pdo_odbc/pdo_odbc.lo
/home/edsradmin/software/php/php-8.0.3/ext/pdo_odbc/pdo_odbc.c:391:2: warning: excess elements in struct initializer
  NULL /* get_gc */
  ^~~~
/home/edsradmin/software/php/php-8.0.3/ext/pdo_odbc/pdo_odbc.c:391:2: note: (near initialization for ‘odbc_methods’)
/bin/bash /home/edsradmin/software/php/php-8.0.3/libtool --silent --preserve-dup-deps --mode=compile cc -Iext/pdo_odbc/ -I/home/edsradmin/software/php/php-8.0.3/ext/pdo_odbc/ -I/home/edsradmin/software/php/php-8.0.3/include -I/home/edsradmin/software/php/php-8.0.3/main -I/home/edsradmin/software/php/php-8.0.3 -I/home/edsradmin/software/php/php-8.0.3/ext/date/lib -I/usr/include/libxml2 -I/home/edsradmin/software/php/php-8.0.3/ext/mbstring/libmbfl -I/home/edsradmin/software/php/php-8.0.3/ext/mbstring/libmbfl/mbfl -I/home/edsradmin/software/php/php-8.0.3/TSRM -I/home/edsradmin/software/php/php-8.0.3/Zend    -Wno-clobbered -Wall -Wextra -Wno-strict-aliasing -Wno-implicit-fallthrough -Wno-unused-parameter -Wno-sign-compare -g -fvisibility=hidden -O0 -DZEND_SIGNALS   -I/home/edsradmin/software/php/php-8.0.3/ext  -I/usr/local/include -DPDO_ODBC_TYPE=\"unixODBC\" -c /home/edsradmin/software/php/php-8.0.3/ext/pdo_odbc/odbc_driver.c -o ext/pdo_odbc/odbc_driver.lo
/home/edsradmin/software/php/php-8.0.3/ext/pdo_odbc/odbc_driver.c: In function ‘pdo_odbc_fetch_error_func’:
/home/edsradmin/software/php/php-8.0.3/ext/pdo_odbc/odbc_driver.c:42:36: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘SDWORD {aka int}’ [-Wformat=]
  message = strpprintf(0, "%s (%s[%ld] at %s:%d)",
                                  ~~^
                                  %d
/home/edsradmin/software/php/php-8.0.3/ext/pdo_odbc/odbc_driver.c:44:18:
     einfo->what, einfo->last_error,
                  ~~~~~~~~~~~~~~~~~
/home/edsradmin/software/php/php-8.0.3/ext/pdo_odbc/odbc_driver.c: In function ‘pdo_odbc_error’:
/home/edsradmin/software/php/php-8.0.3/ext/pdo_odbc/odbc_driver.c:88:41: warning: pointer targets in passing argument 4 of ‘SQLGetDiagRec’ differ in signedness [-Wpointer-sign]
  rc = SQLGetDiagRec(htype, eh, recno++, einfo->last_state, &einfo->last_error,
                                         ^~~~~
In file included from /usr/local/include/sqlext.h:43:0,
                 from /usr/local/include/sqlucode.h:784,
                 from /home/edsradmin/software/php/php-8.0.3/ext/pdo_odbc/php_pdo_odbc_int.h:51,
                 from /home/edsradmin/software/php/php-8.0.3/ext/pdo_odbc/odbc_driver.c:27:
/usr/local/include/sql.h:726:24: note: expected ‘SQLCHAR * {aka unsigned char *}’ but argument is of type ‘char *’
     SQLRETURN  SQL_API SQLGetDiagRec(SQLSMALLINT HandleType, SQLHANDLE Handle,
                        ^~~~~~~~~~~~~
/home/edsradmin/software/php/php-8.0.3/ext/pdo_odbc/odbc_driver.c:89:4: warning: pointer targets in passing argument 6 of ‘SQLGetDiagRec’ differ in signedness [-Wpointer-sign]
    einfo->last_err_msg, sizeof(einfo->last_err_msg)-1, &errmsgsize);
    ^~~~~
 [2021-03-17 14:22 UTC] sergiopaternoster73 at gmail dot com
I cloned the whole 8.1.0-dev and the warnings disappeared. Thank you! Please, close this bug.
 [2021-03-17 15:37 UTC] nikic@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: nikic
 [2021-03-17 15:37 UTC] nikic@php.net
I've cherry-picked our warning fixes from master to the PHP-8.0 branch. I think all of those warnings are harmless though, I don't think any of them indicated any actual functional problems.
 [2021-03-17 16:10 UTC] sergiopaternoster73 at gmail dot com
You are right. Even without warnings my problems with Unicode chars unreadable are still there (I've opened bug #80869 for this).

Thank you for your help anyway!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 15:01:32 2024 UTC