Re: Compiler warnings in psqloodbc 08.03.0200

From: "Hiroshi Saito" <z-saito(at)guitar(dot)ocn(dot)ne(dot)jp>
To: "Adam M" <gnuman1(at)gmail(dot)com>, <pgsql-odbc(at)postgresql(dot)org>
Cc: "Hiroshi Inoue" <inoue(at)tpf(dot)co(dot)jp>
Subject: Re: Compiler warnings in psqloodbc 08.03.0200
Date: 2008-10-03 14:42:36
Message-ID: 009e01c92566$47154d00$0e01a8c0@IBMC9A0F63B40D
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

Hi.

Umm, We can't know in which mode the package (rpm) of unixODBC is built and released.
Supposing it defines as sqltypes.h of Debian compulsorily, it will be used also for our
psqlODBC.
Then, that to which Debian is then supplied is clear. However, unixODBC in which a
definition
is not found does not understand whether it is the 64-bit mode.

I think that the supplier of unixODBC should have the responsibility. it will be clear if
expressed
by "odbc_config --cflags". Then, Is BUILD_REAL_64_BIT_MODE of a definition in some
document? and, How does a user use?

Therefore, I think that supply of the present psqlODBC is the best.

Regards,
Hiroshi Saito

----- Original Message -----
From: "Adam M" <gnuman1(at)gmail(dot)com>

> On Wed, Oct 1, 2008 at 9:40 AM, Hiroshi Saito <z-saito(at)guitar(dot)ocn(dot)ne(dot)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.
>
> --
> Sent via pgsql-odbc mailing list (pgsql-odbc(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-odbc

In response to

Responses

Browse pgsql-odbc by date

  From Date Subject
Next Message Adam M 2008-10-03 22:00:11 Re: Compiler warnings in psqloodbc 08.03.0200
Previous Message Adam M 2008-10-02 23:52:57 Re: Compiler warnings in psqloodbc 08.03.0200