php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76021 cast to pointer from integer of different size [-Wint-to-pointer-cast]
Submitted: 2018-02-27 18:22 UTC Modified: 2021-08-18 10:54 UTC
Votes:4
Avg. Score:4.8 ± 0.4
Reproduced:2 of 4 (50.0%)
Same Version:2 (100.0%)
Same OS:0 (0.0%)
From: greg dot bryant at aksteel dot coma Assigned: cmb (profile)
Status: Closed Package: ibm_db2 (PECL)
PHP Version: 7.2.2 OS: Ubuntu 16.04
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
27 + 44 = ?
Subscribe to this entry?

 
 [2018-02-27 18:22 UTC] greg dot bryant at aksteel dot coma
Description:
------------
same issue with ibm_db2 2.02 and 2.01;

phpize
Configuring for:
PHP Api Version:         20170718
Zend Module Api No:      20170718
Zend Extension Api No:   320170718

tried:
./configure
./configure --with-IBM_DB2=/home/db2inst1/sqllib/
./configure --with-IBM_DB2=/opt/ibm/db2/V11.1/

then make . . . long list of warnings: cast to pointer from integer of different size [-Wint-to-pointer-cast] . . . 
Makefile:194: recipe for target 'ibm_db2.lo' failed
make: *** [ibm_db2.lo] Error 1



Patches

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-02-27 18:45 UTC] greg dot bryant at aksteel dot coma
SQLPOINTER Datatype has a vParam argument.  "vParam can be a pointer to a 32-bit integer value or a character string."  I'm on a 64-bit system.

not sure if this is relevant or not.
 [2018-02-27 18:45 UTC] greg dot bryant at aksteel dot coma
SQLPOINTER Datatype has a vParam argument.  "vParam can be a pointer to a 32-bit integer value or a character string."  I'm on a 64-bit system.

not sure if this is relevant or not.
 [2018-03-16 16:00 UTC] guy dot baconniere at applic8 dot com
same issue with ibm_db2 2.02 on Ubuntu 18.04 -- LTS next month

tried:

DB2 Installation Directory? : /opt/ibm/dsdriver
from ibm_data_server_driver_package_linuxx64_v11.1.tar.gz

DB2 Installation Directory? : /opt/ibm/dsdriver
from ibm_data_server_driver_package_linuxx64_v10.5.tar.gz

DB2 Installation Directory? : /home/db2inst1/sqllib
DB2 Installation Directory? : /opt/ibm/db2/V10.5
from DB2 10.5


root@a8dev:~# pecl install ibm_db2
downloading ibm_db2-2.0.2.tgz ...
Starting to download ibm_db2-2.0.2.tgz (190,222 bytes)
.........................................done: 190,222 bytes
5 source files, building
running: phpize
Configuring for:
PHP Api Version:         20170718
Zend Module Api No:      20170718
Zend Extension Api No:   320170718
DB2 Installation Directory? : /opt/ibm/dsdriver
building in /tmp/pear/temp/pear-build-rootEwtUBL/ibm_db2-2.0.2
running: /tmp/pear/temp/ibm_db2/configure --with-php-config=/usr/bin/php-config --with-IBM_DB2=/opt/ibm/dsdriver
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php/20170718 -I/usr/include/php/20170718/main -I/usr/include/php/20170718/TSRM -I/usr/include/php/20170718/Zend -I/usr/include/php/20170718/ext -I/usr/include/php/20170718/ext/date/lib
checking for PHP extension directory... /usr/lib/php/20170718
checking for PHP installed headers prefix... /usr/include/php/20170718
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... re2c
checking for re2c version... 1.0.1 (ok)
checking for gawk... gawk
checking for IBM_DB2 support... yes, shared
checking PHP... Detected 64-bit PHP
checking IBM_DB_HOME location... not found
checking Looking for DB2 CLI libraries... checking      in /opt/ibm/dsdriver...
checking      in /opt/ibm/dsdriver/lib64... found
checking for DB2 CLI include files in default path... checking in /opt/ibm/dsdriver... found in /opt/ibm/dsdriver
checking how to print strings... printf
checking for a sed that does not truncate output... (cached) /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking for gawk... (cached) gawk
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC -DPIC
checking if cc PIC flag -fPIC -DPIC works... yes
checking if cc static flag -static works... yes
checking if cc supports -c -o file.o... yes
checking if cc supports -c -o file.o... (cached) yes
checking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
configure: creating ./config.status
config.status: creating config.h
config.status: executing libtool commands
running: make
/bin/bash /tmp/pear/temp/pear-build-rootEwtUBL/ibm_db2-2.0.2/libtool --mode=compile cc  -I. -I/tmp/pear/temp/ibm_db2 -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootEwtUBL/ibm_db2-2.0.2/include -I/tmp/pear/temp/pear-build-rootEwtUBL/ibm_db2-2.0.2/main -I/tmp/pear/temp/ibm_db2 -I/usr/include/php/20170718 -I/usr/include/php/20170718/main -I/usr/include/php/20170718/TSRM -I/usr/include/php/20170718/Zend -I/usr/include/php/20170718/ext -I/usr/include/php/20170718/ext/date/lib -I/opt/ibm/dsdriver/include  -DHAVE_CONFIG_H  -g -O2   -c /tmp/pear/temp/ibm_db2/ibm_db2.c -o ibm_db2.lo
libtool: compile:  cc -I. -I/tmp/pear/temp/ibm_db2 -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootEwtUBL/ibm_db2-2.0.2/include -I/tmp/pear/temp/pear-build-rootEwtUBL/ibm_db2-2.0.2/main -I/tmp/pear/temp/ibm_db2 -I/usr/include/php/20170718 -I/usr/include/php/20170718/main -I/usr/include/php/20170718/TSRM -I/usr/include/php/20170718/Zend -I/usr/include/php/20170718/ext -I/usr/include/php/20170718/ext/date/lib -I/opt/ibm/dsdriver/include -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/ibm_db2/ibm_db2.c  -fPIC -DPIC -o .libs/ibm_db2.o
In file included from /opt/ibm/dsdriver/include/sqlcli1.h:45:0,
                 from /tmp/pear/temp/ibm_db2/php_ibm_db2.h:37,
                 from /tmp/pear/temp/ibm_db2/ibm_db2.c:34:
/opt/ibm/dsdriver/include/sqlcli.h:874:0: warning: "ODBCVER" redefined
 #define ODBCVER 0x0380

In file included from /usr/include/php/20170718/main/php.h:34:0,
                 from /tmp/pear/temp/ibm_db2/ibm_db2.c:30:
/usr/include/php/20170718/main/php_config.h:2241:0: note: this is the location of the previous definition
 #define ODBCVER 0x0300

/tmp/pear/temp/ibm_db2/ibm_db2.c:130:0: warning: "ZEND_GET_TYPE" redefined
 #define ZEND_GET_TYPE(data) (data)->u1.v.type

In file included from /usr/include/php/20170718/Zend/zend_compile.h:833:0,
                 from /usr/include/php/20170718/Zend/zend_modules.h:26,
                 from /usr/include/php/20170718/Zend/zend_API.h:27,
                 from /usr/include/php/20170718/main/php.h:40,
                 from /tmp/pear/temp/ibm_db2/ibm_db2.c:30:
/usr/include/php/20170718/Zend/zend_vm_opcodes.h:267:0: note: this is the location of the previous definition
 #define ZEND_GET_TYPE                        193

/tmp/pear/temp/ibm_db2/ibm_db2.c: In function ‘_php_db2_assign_options’:
/tmp/pear/temp/ibm_db2/ibm_db2.c:1379:59: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
                                     SQL_ATTR_CURSOR_TYPE, (SQLPOINTER)vParam,
                                                           ^
/tmp/pear/temp/ibm_db2/ibm_db2.c:1388:59: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
                                     SQL_ATTR_CURSOR_TYPE, (SQLPOINTER)vParam, /* was (SQLPOINTER)&vParam */
                                                           ^
/tmp/pear/temp/ibm_db2/ibm_db2.c:1400:59: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
                                     SQL_ATTR_CURSOR_TYPE, (SQLPOINTER)vParam,
                                                           ^
/tmp/pear/temp/ibm_db2/ibm_db2.c:1408:59: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
                                     SQL_ATTR_CURSOR_TYPE, (SQLPOINTER)vParam, /* was (SQLPOINTER)&vParam */
                                                           ^
/tmp/pear/temp/ibm_db2/ibm_db2.c:1437:61: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
                                 SQL_ATTR_ROWCOUNT_PREFETCH, (SQLPOINTER)vParam,
                                                             ^
/tmp/pear/temp/ibm_db2/ibm_db2.c:1446:61: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
                                 SQL_ATTR_ROWCOUNT_PREFETCH, (SQLPOINTER)vParam, /* was (SQLPOINTER)&vParam */
                                                             ^
/tmp/pear/temp/ibm_db2/ibm_db2.c:1458:61: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
                                 SQL_ATTR_ROWCOUNT_PREFETCH, (SQLPOINTER)vParam,
                                                             ^
/tmp/pear/temp/ibm_db2/ibm_db2.c:1466:61: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
                                 SQL_ATTR_ROWCOUNT_PREFETCH, (SQLPOINTER)vParam, /* was (SQLPOINTER)&vParam */
                                                             ^
/tmp/pear/temp/ibm_db2/ibm_db2.c:1575:104: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
                     rc = SQLSetConnectAttr((SQLHDBC)((conn_handle*)handle)->hdbc, SQL_ATTR_AUTOCOMMIT, (SQLPOINTER)pvParam, SQL_IS_INTEGER);
                                                                                                        ^
/tmp/pear/temp/ibm_db2/ibm_db2.c:1587:104: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
                     rc = SQLSetConnectAttr((SQLHDBC)((conn_handle*)handle)->hdbc, SQL_ATTR_AUTOCOMMIT, (SQLPOINTER)pvParam, SQL_IS_INTEGER);
                                                                                                        ^
/tmp/pear/temp/ibm_db2/ibm_db2.c:1701:103: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
                 rc = SQLSetConnectAttr((SQLHDBC)((conn_handle*)handle)->hdbc, SQL_ATTR_TXN_ISOLATION, (SQLPOINTER)pvParam, SQL_IS_INTEGER);
                                                                                                       ^
/tmp/pear/temp/ibm_db2/ibm_db2.c:1725:104: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
                 rc = SQLSetConnectAttr((SQLHDBC)((conn_handle*)handle)->hdbc, SQL_ATTR_DBC_SYS_NAMING, (SQLPOINTER)pvParam, SQL_IS_INTEGER);
                                                                                                        ^
/tmp/pear/temp/ibm_db2/ibm_db2.c:1799:98: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
                 rc = SQLSetConnectAttr((SQLHDBC)((conn_handle*)handle)->hdbc, SQL_ATTR_DATE_FMT, (SQLPOINTER)pvParam, SQL_IS_INTEGER);
                                                                                                  ^
/tmp/pear/temp/ibm_db2/ibm_db2.c:1824:98: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
                 rc = SQLSetConnectAttr((SQLHDBC)((conn_handle*)handle)->hdbc, SQL_ATTR_DATE_SEP, (SQLPOINTER)pvParam, SQL_IS_INTEGER);
                                                                                                  ^
/tmp/pear/temp/ibm_db2/ibm_db2.c:1847:98: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
                 rc = SQLSetConnectAttr((SQLHDBC)((conn_handle*)handle)->hdbc, SQL_ATTR_TIME_FMT, (SQLPOINTER)pvParam, SQL_IS_INTEGER);
                                                                                                  ^
/tmp/pear/temp/ibm_db2/ibm_db2.c:1870:98: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
                 rc = SQLSetConnectAttr((SQLHDBC)((conn_handle*)handle)->hdbc, SQL_ATTR_TIME_SEP, (SQLPOINTER)pvParam, SQL_IS_INTEGER);
                                                                                                  ^
/tmp/pear/temp/ibm_db2/ibm_db2.c:1889:101: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
                 rc = SQLSetConnectAttr((SQLHDBC)((conn_handle*)handle)->hdbc, SQL_ATTR_DECIMAL_SEP, (SQLPOINTER)pvParam, SQL_IS_INTEGER);
                                                                                                     ^
/tmp/pear/temp/ibm_db2/ibm_db2.c:2015:52: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
                         SQL_ATTR_DEFERRED_PREPARE, (SQLPOINTER)pvParam,
                                                    ^
/tmp/pear/temp/ibm_db2/ibm_db2.c:2025:52: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
                         SQL_ATTR_DEFERRED_PREPARE, (SQLPOINTER)pvParam,
                                                    ^
/tmp/pear/temp/ibm_db2/ibm_db2.c: In function ‘_php_db2_connect_helper’:
/tmp/pear/temp/ibm_db2/ibm_db2.c:2756:78: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
         rc = SQLSetConnectAttr((SQLHDBC)conn_res->hdbc, SQL_ATTR_AUTOCOMMIT, (SQLPOINTER)(conn_res->auto_commit), SQL_IS_INTEGER);
                                                                              ^
/tmp/pear/temp/ibm_db2/ibm_db2.c: In function ‘zif_db2_autocommit’:
/tmp/pear/temp/ibm_db2/ibm_db2.c:3115:82: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
             rc = SQLSetConnectAttr((SQLHDBC)conn_res->hdbc, SQL_ATTR_AUTOCOMMIT, (SQLPOINTER)autocommit, SQL_IS_INTEGER);
                                                                                  ^
/tmp/pear/temp/ibm_db2/ibm_db2.c: In function ‘zif_db2_execute’:
/tmp/pear/temp/ibm_db2/ibm_db2.c:5106:107: error: ‘IS_TYPE_IMMUTABLE’ undeclared (first use in this function); did you mean ‘IS_ARRAY_IMMUTABLE’?
     if (parameters_array && Z_TYPE_P(parameters_array) == IS_ARRAY && (Z_TYPE_FLAGS_P(parameters_array) & IS_TYPE_IMMUTABLE)) {
                                                                                                           ^~~~~~~~~~~~~~~~~
                                                                                                           IS_ARRAY_IMMUTABLE
/tmp/pear/temp/ibm_db2/ibm_db2.c:5106:107: note: each undeclared identifier is reported only once for each function it appears in
/tmp/pear/temp/ibm_db2/ibm_db2.c: In function ‘zif_db2_execute_many’:
/tmp/pear/temp/ibm_db2/ibm_db2.c:7820:77: error: ‘IS_TYPE_IMMUTABLE’ undeclared (first use in this function); did you mean ‘IS_ARRAY_IMMUTABLE’?
     if (params && Z_TYPE_P(params) == IS_ARRAY && (Z_TYPE_FLAGS_P(params) & IS_TYPE_IMMUTABLE)) {
                                                                             ^~~~~~~~~~~~~~~~~
                                                                             IS_ARRAY_IMMUTABLE
Makefile:194: recipe for target 'ibm_db2.lo' failed
make: *** [ibm_db2.lo] Error 1
ERROR: `make' failed
root@a8dev:~# php --version
PHP 7.2.2-1ubuntu2 (cli) (built: Feb 28 2018 08:43:55) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.2-1ubuntu2, Copyright (c) 1999-2018, by Zend Technologies

root@a8dev:~# lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu Bionic Beaver (development branch)
Release:	18.04
Codename:	bionic
 [2018-04-03 11:58 UTC] guy dot baconniere at applic8 dot com
If you are not able to compile ibm_db2 with PHP 7.2
check https://bugs.php.net/bug.php?id=76112
 [2018-08-14 06:43 UTC] vnkbabu@php.net
Latest ibm_db2 release has the support for PHP 7.2. Please check with the latest driver.
 [2019-02-19 23:04 UTC]
The following pull request has been associated:

Patch Name: Fix warnings about int to pointer conversions when sizes don't match
On GitHub:  https://github.com/php/pecl-database-ibm_db2/pull/7
Patch:      https://github.com/php/pecl-database-ibm_db2/pull/7.patch
 [2019-03-06 08:39 UTC] unknown at latvia dot lv
PEAR Version: 1.10.8
PHP Version: 7.3.2-3+0~20190208150725.31+stretch~1.gbp0912bd
Zend Engine Version: 3.3.2
Debian 4.9.130-2 (2018-10-27) x86_64

Also have this problem
 [2021-08-18 10:54 UTC] cmb@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2021-08-18 10:54 UTC] cmb@php.net
The attached PR had been merged, so this is supposed to be
resolved as of ibm_db2 2.1.0.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 18:01:34 2024 UTC