Skip to Content.
Sympa Menu

freetds - Re: [freetds] CS_INT size bug

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: entropy AT freetds.org
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] CS_INT size bug
  • Date: Tue, 05 Sep 2006 10:02:53 -0400

Norbert Sendetzky wrote:
On Monday 04 September 2006 23:25, freetds-request AT lists.ibiblio.org wrote:
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.

I assume, you've used gcc which probably don't define long to 64 bit. Maybe it's only a problem when using the native plattform compiler - but who does this today.

On the other hand, did you get warnings in -Wall -pedantic mode?

It doesn't get warnings with gcc. It doesn't get warnings with gcc -Wall -pedantic. It doesn't get warnings with the native platform compiler.

In fact, there is no reason why it should get any warnings with any compiler with any switches on any platform where long is at least 32 bits (and I guarantee you that that applies to every host you're ever likely to care about), which is precisely why I suggested the code to you in the first place.

The code I suggested is *correct*. Instead of speculating endlessly why don't you just try it?

--
Cheers,
entropy




Archive powered by MHonArc 2.6.24.

Top of Page