Re: Fix compiler warnings on 64-bit Windows
От | Tom Lane |
---|---|
Тема | Re: Fix compiler warnings on 64-bit Windows |
Дата | |
Msg-id | 23439.1581607190@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Fix compiler warnings on 64-bit Windows (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>) |
Ответы |
Re: Fix compiler warnings on 64-bit Windows
|
Список | pgsql-hackers |
Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes: > 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] > 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. Hm. Silencing the warnings is a laudable goal, but I'm very dubious of allowing these test files to depend on pg_config.h. That doesn't correspond to real-world ECPG usage, so it seems likely that it could come back to bite us some day. According to C99 and POSIX, intptr_t should be provided by <stdint.h> ... now that we're requiring C99, can we get away with just #include'ing that directly in these test files? regards, tom lane
В списке pgsql-hackers по дате отправления: