Re: Compiler warnings in psqloodbc 08.03.0200

Поиск
Список
Период
Сортировка
От Adam M
Тема Re: Compiler warnings in psqloodbc 08.03.0200
Дата
Msg-id 84b37b360810021652o7c3a9741kd90fdca743728323@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Compiler warnings in psqloodbc 08.03.0200  ("Hiroshi Saito" <z-saito@guitar.ocn.ne.jp>)
Список pgsql-odbc
On Wed, Oct 1, 2008 at 9:40 AM, Hiroshi Saito <z-saito@guitar.ocn.ne.jp> wrote:
>> Zoltan Boszormenyi wrote:
>> They may come from the strange handling of unixODBC's
>> 64bit ODBC. Honestly I don't understand how to use
>> 64-bit unixODBC correctly. Probably you can remove the
>>  warnings by #defining BUILD_REAL_64_BIT_MODE somewhere.


BUILD_REAL_64_BIT_MODE must be defined on 64-bit architectures.
Compiling under 64-bit without this will creates messed up ABI driver
that is NOT ODBC64. If you look on msdn, ODBC64 definitions are
correct only if BUILD_REAL_64_BIT_MODE is defined.

In this mode, SQLLEN is 64-bit. SQLINTEGER is 32-bit.

If the BUILD_REAL_64_BIT_MODE is not defined, then SQLLEN is defined
to be SQLINTEGER which is incorrect for 64-bit ODBC.

Therefore, the only correct scenario is for PostgreSQL's ODBC driver
to work with unixODBC with the BUILD_REAL_64_BIT_MODE for 64-bit and
ignore the other stuff as it is incorrect.

- Adam

PS. On Debian, unixODBC's sqltypes.h has been modified by the
maintainer to include,

/*
 * Failing to define this is *absolutely* broken on 64-bit archs, and we
 * are setting it in the Debian build, so use of this ABI is mandatory.
 * If you don't like it, go build your own non-64-bit-clean library instead.
 * SRL 2006-03-04
 */
#ifndef BUILD_REAL_64_BIT_MODE
#define BUILD_REAL_64_BIT_MODE
#endif

I would just add a check that verifies that when sizeof(long) == 8,
that sizeof(SQLLEN) ==8 as well, otherwise the unixODBC install is not
according to ODBC64 specs.

В списке pgsql-odbc по дате отправления:

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: ODBC Driver crash with MS Access 2007 (from GENERAL)
Следующее
От: "Hiroshi Saito"
Дата:
Сообщение: Re: Compiler warnings in psqloodbc 08.03.0200