[freetds] FreeTDS Digest, Vol 44, Issue 4

Christos Zoulas christos at zoulas.com
Mon Sep 4 14:21:26 EDT 2006


On Sep 4,  2:15pm, entropy at freetds.org (entropy at freetds.org) wrote:
-- Subject: Re: [freetds] FreeTDS Digest, Vol 44, Issue 4

| Irrelevant to what we were discussing: use of the FreeTDS-defined CS_INT 
| from user application code.  CS_INT is part of CS-Library/CT-Library, 
| not ODBC.

CS_INT should be int32_t, since it needs to be a 4 byte signed integer.
This is the problem. CS_INT is abused by the ODBC API (is that a formal
API?) to pass pointers around, and this of course does not work. Defining
CS_INT to long on LP32 machines is not very useful, but at least works
(modulo printf format breakage, that can be handled with casts).
Defining CS_INT to be long on 64 bit machines, plainly does not work.

| > Don't you get warnings when compiling?
| 
| If you mean when compiling the FreeTDS OBDC library, yes, I do.  I don't 
| know enough about ODBC to fix it.  Do you have a patch to offer?

I can silense the compiler, but I cannot provide a patch that works, since
it is impossible to fit 8 byte arbitrary pointers into 4 bytes. What needs
to be done, is to introduce CS_POINTER and use it where pointers are needed.
This is an API change.

christos



More information about the FreeTDS mailing list