Обсуждение: psqlodbc-08.00.0101 compile error

Поиск
Список
Период
Сортировка

psqlodbc-08.00.0101 compile error

От
"Rhys Ickeringill"
Дата:
Hi

I've just unsuccesfully attempted to build psqlodbc-08.00.0101 on my linux
system and have got a compile error in odbcapi30w.c. I must add that I'm not
certain this is psqlodbc's problem, it may belong to iODBC...

The function 'SQLColAttributeW' signature in this file differs from the one
in "sqlucode.h" provided by libiodbc-3.52.2. Specifically, the final
parameter 'pNumAttr' definitions don't match. GCC-3.3.4 is pulling this up
as an error.

from psqlodbc-08.00.0101's odbcapi30w.c :

RETCODE SQL_API SQLColAttributeW(
    SQLHSTMT hstmt,
    SQLUSMALLINT iCol,
    SQLUSMALLINT iField,
    SQLPOINTER pCharAttr,
    SQLSMALLINT cbCharAttrMax,
    SQLSMALLINT *pcbCharAttr,
    SQLPOINTER pNumAttr )

from libiodbc-3.52.2's sqlucode.h (included by odbcapi30w.c) :

RETCODE SQL_API SQLColAttributeW(
    SQLHSTMT hstmt,
    SQLUSMALLINT iCol,
    SQLUSMALLINT iField,
    SQLPOINTER pCharAttr,
    SQLSMALLINT cbCharAttrMax,
    SQLSMALLINT *pcbCharAttr,
    SQLLEN *pNumAttr )

In libiodbc-3.52.2's sqltypes.h SQLLEN is #defined as a long, SQLPOINTER is
typedefed to void*, hence the compiler's complaint - "conflicting types for
SQLColAttributeW"

Perhaps also of concern is that within SQLColAttributeW, pNumAttr is then
passed to a function (PGAPI_ColumnPrivileges) expecting a SQLINTEGER*.

Regards,

Rhys


Re: psqlodbc-08.00.0101 compile error

От
Peter Eisentraut
Дата:
Am Mittwoch, 9. März 2005 01:43 schrieb Rhys Ickeringill:
> from psqlodbc-08.00.0101's odbcapi30w.c :
>
> RETCODE SQL_API SQLColAttributeW(
>     SQLHSTMT hstmt,
>     SQLUSMALLINT iCol,
>     SQLUSMALLINT iField,
>     SQLPOINTER pCharAttr,
>     SQLSMALLINT cbCharAttrMax,
>     SQLSMALLINT *pcbCharAttr,
>     SQLPOINTER pNumAttr )
>
> from libiodbc-3.52.2's sqlucode.h (included by odbcapi30w.c) :
>
> RETCODE SQL_API SQLColAttributeW(
>     SQLHSTMT hstmt,
>     SQLUSMALLINT iCol,
>     SQLUSMALLINT iField,
>     SQLPOINTER pCharAttr,
>     SQLSMALLINT cbCharAttrMax,
>     SQLSMALLINT *pcbCharAttr,
>     SQLLEN *pNumAttr )

Both Microsoft and unixODBC agree with our version, and the SQL standard says
it's SQLINTEGER *, so I'm afraid iODBC loses this vote.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

Re: psqlodbc-08.00.0101 compile error

От
tomas@nocrew.org (Tomas Skäre)
Дата:
Peter Eisentraut <peter_e@gmx.net> writes:

> Am Mittwoch, 9. März 2005 01:43 schrieb Rhys Ickeringill:
> > from psqlodbc-08.00.0101's odbcapi30w.c :
> >
> >     SQLPOINTER pNumAttr )
> >
> > from libiodbc-3.52.2's sqlucode.h (included by odbcapi30w.c) :
> >
> >     SQLLEN *pNumAttr )
>
> Both Microsoft and unixODBC agree with our version, and the SQL standard says
> it's SQLINTEGER *, so I'm afraid iODBC loses this vote.

May I suggest an #ifdef WITH_IODBC around it?


Tomas

Re: psqlodbc-08.00.0101 compile error

От
Peter Eisentraut
Дата:
Tomas Skäre wrote:
> > Both Microsoft and unixODBC agree with our version, and the SQL
> > standard says it's SQLINTEGER *, so I'm afraid iODBC loses this
> > vote.
>
> May I suggest an #ifdef WITH_IODBC around it?

That would be the easy way out.  There are, however, two arguments
against that:

1. Previous iODBC releases apparently got this right, so we might be
breaking those releases.

2. Using SQLLEN for an attribute number is just plain wrong.

I suggest that those interested in this issue first contact the iODBC
authors and check why it was done this way.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/