[freetds] FreeTDS Digest, Vol 44, Issue 4

Christos Zoulas christos at zoulas.com
Mon Sep 4 13:58:27 EDT 2006

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

| Norbert Sendetzky wrote:
| > On Monday 04 September 2006 18:00, freetds-request at lists.ibiblio.org wrote:
| >> The problem is that your code is making assumptions about what type a
| >> CS_INT is.  If it were reasonable for your code to do that, then there
| >> would be no such thing as a CS_INT, and instead it would just be "int"
| >> or "long".
| >>
| >> The most portable thing your code can do in this case is explicitly cast
| >> to a type, then use the printf(3) format for that type.
| >>
| >> CS_INT foo;
| >> ...
| >> printf("%ld\n", (long) foo);
| >>
| >> That should compile without warnings and execute properly, using FreeTDS
| >> or Sybase headers, on any 32 or 64 bit platform.
| > 
| > It's not that I want to make assumptions about types but printf forces me to 
| > do so. Your example above works as long as it doesn't hit a plattform 
| > where "long" is defined as 64 bit type (e.g. Alpha, AIX). On these 
| > plattforms, it will fail miserably.
| Err, no, it works just fine on Alpha where I just tested it, and I see 
| no reason why it shouldn't work on any other platform with 64-bit longs. 
|   Can you explain why you think it should "fail miserably?"  If so, 
| perhaps I can help you see where you're going wrong.

The odbc stuff cannot possibly work, for the reasons I explained in a previous
post. Don't you get warnings when compiling?


More information about the FreeTDS mailing list