Bug #80876 [Opn]: Compile errors/warnings with unixODBC

From: Date: Wed, 17 Mar 2021 12:58:54 +0000
Subject: Bug #80876 [Opn]: Compile errors/warnings with unixODBC
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-232812@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=80876&edit=1

 ID:                 80876
 Updated by:         nikic@php.net
 Reported by:        sergiopaternoster73 at gmail dot com
 Summary:            Compile errors/warnings with unixODBC
 Status:             Open
 Type:               Bug
 Package:            PDO ODBC
 Operating System:   Ubuntu 18.04 Server
 PHP Version:        8.0.3
 Block user comment: N
 Private report:     N

 New Comment:

Does cherry-picking https://github.com/php/php-src/commit/aa58db723221ec891d4432621003bfa55dc15edf
fix the warnings?


Previous Comments:
------------------------------------------------------------------------
[2021-03-17 12:05:22] 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



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=80876&edit=1


Thread (6 messages)

« previous php.bugs (#232812) next »