postgresql/src/interfaces/ecpg/test
Peter Eisentraut 3f9c1697dc Fix compiler warnings on 64-bit Windows
GCC reports various instances of

warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]

and MSVC equivalently

warning C4312: 'type cast': conversion from 'int' to 'void *' of greater size
warning C4311: 'type cast': pointer truncation from 'void *' to 'long'

in ECPG test files.  This is because void* and long are cast back and
forth, but on 64-bit Windows, these have different sizes.  Fix by
using intptr_t instead.

The code actually worked fine because the integer values in use are
all small.  So this is just to get the test code to compile warning-free.

This change is simplified by having made stdint.h required (commit
957338418b).  Before this it would have
been more complicated because the ecpg test source files don't use the
full pg_config.h.

Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://www.postgresql.org/message-id/flat/5d398bbb-262a-5fed-d839-d0e5cff3c0d7%402ndquadrant.com
2020-02-21 19:58:39 +01:00
..
compat_informix Make some ecpg test cases more robust against unexpected errors that happen 2019-01-30 10:39:32 +01:00
compat_oracle Make some ecpg test cases more robust against unexpected errors that happen 2019-01-30 10:39:32 +01:00
connect Stop using spelling "nonexistant". 2019-06-08 10:12:26 -07:00
expected Fix compiler warnings on 64-bit Windows 2020-02-21 19:58:39 +01:00
performance Remove unnecessary parentheses in return statements 2017-09-05 14:52:55 -04:00
pgtypeslib Fix off-by-one error in PGTYPEStimestamp_fmt_asc 2019-11-30 14:51:27 +01:00
preproc Stop using spelling "nonexistant". 2019-06-08 10:12:26 -07:00
sql Remove HAVE_LONG_LONG_INT 2019-11-07 13:30:04 +01:00
thread Fix compiler warnings on 64-bit Windows 2020-02-21 19:58:39 +01:00
.gitignore Still more .gitignore cleanup. 2010-09-24 13:48:15 -04:00
Makefile Move logging.h and logging.c from src/fe_utils/ to src/common/. 2019-05-14 14:20:10 -04:00
Makefile.regress Ensure link commands list *.o files before LDFLAGS. 2019-01-02 13:57:54 -05:00
ecpg_schedule Revert "Add DECLARE STATEMENT support to ECPG." 2019-09-20 12:47:37 -04:00
pg_regress_ecpg.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
printf_hack.h Un-break ecpg tests for Windows. 2019-06-02 11:07:54 -04:00
regression.h Initial pgindent run with pg_bsd_indent version 2.0. 2017-06-21 14:39:04 -04:00