cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: __floatdidf on Solaris 2.6 and gcc 3.2

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 28 Oct 2002 10:18:54 +0100 (MET)

On Wed, 23 Oct 2002, Andreas Baumann wrote:

> Compiling libcurl 0.9.7, gcc 3.2, Solaris 2.6 results in:
> Undefined first referenced
> symbol in file
> __floatdidf file.lo
> ld: fatal: Symbol referencing errors. No output written to
> .libs/libcurl.so.2.0.2
>
> The problem in lib/file.c is the following cast:
>
> expected_size = (double)statbuf.st_size;
>
> As st_size is normally something like off_t (which is nowadays defined to
> something with 64 bits).
>
> The hint to use -lgcc_s to the link options is not very good (as it makes
> the code depend on the compiler!). IMHO

It makes the code depend on a library that the compiler introduced, yes.
Still, that's how gcc solves these things.

> I rather suggest a cast like:
>
> expected_size = (double)((unsigned long)statbuf.st_size);

That would then first convert it to an unsigned long and then to a double,
which I believe will make it lose precision.

Perhaps a better approach would be to take a general stab at making libcurl
support >2GB and >4GB files...

-- 
 Daniel Stenberg -- curl, cURL, Curl, CURL. Groks URLs.
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Received on 2002-10-28