Bojan Smojver wrote:
I'm getting these on Fedora 9, x86_64:
-----------------------
dbd/apr_dbd_odbc.c: In function ‘odbc_open’:
dbd/apr_dbd_odbc.c:1010: warning: cast to pointer from integer of
different size
dbd/apr_dbd_odbc.c: In function ‘odbc_start_transaction’:
dbd/apr_dbd_odbc.c:1101: warning: cast to pointer from integer of
different size
dbd/apr_dbd_odbc.c: In function ‘odbc_get_entry’:
dbd/apr_dbd_odbc.c:1310: warning: cast from pointer to integer of
different size
dbd/apr_dbd_odbc.c: In function ‘odbc_transaction_mode_set’:
dbd/apr_dbd_odbc.c:1496: warning: cast to pointer from integer of
different size
-----------------------

That's for these lines:
-----------------------
rc = SQLSetConnectAttr(hdbc, attrs[i], (void *) attrvals[i], 0);
...
rc = SQLSetConnectAttr(handle->dbc, SQL_ATTR_TXN_ISOLATION, (void *)
                               handle->transaction_mode, 0);
...
if ((signed int) p > 0)
...
rc = SQLSetConnectAttr(trans->dbc, SQL_ATTR_TXN_ISOLATION,
                           (void *) mode, 0);
-----------------------

Pointers on 64-bit Linux machines are 64-bit values, integers are 32-bit
values, hence the warnings.

Just making sure all this is really intended here...

The Microsoft ODBC docs at 
http://msdn.microsoft.com/en-us/library/ms713605(VS.85).aspx say:

  SQLPOINTER      ValuePtr
  [Input] Pointer to the value to be associated with Attribute. Depending on 
the value of
  Attribute, ValuePtr will be a 32-bit unsigned integer value or will point to 
a null-terminated
  character string. Note that if the Attribute argument is a driver-specific 
value, the value in
  ValuePtr may be a signed integer.

The DB2 CLI/ODBC docs say the same - http://publib.boulder.ibm.com/infocenter/db2luw/v8/topic/com.ibm.db2.udb.doc/ad/r0000646.htm

UnixODBC & iODBC usually treat the MS ODBC docs as authoritative, so it seems likely that this is as intended. I don't have a 64-bit system to give it a try on.

hmmm...   ODBC really shows its age here!

-tom-

Reply via email to