cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: libCurl 7.16.0, MSVC 6.0: datatype of curl_off_t raises warning C4244 in transfer.c(1147)

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 5 Dec 2006 22:35:58 +0100 (CET)

On Tue, 5 Dec 2006, Stefan Krause wrote:

> transfer.c(1147) : warning C4244: 'function' : conversion from '__int64 ' to
> 'unsigned int ', possible loss of data

"possible" is still the keyword here and in this case it will never overflow.

> Is this a libcurl problem or do I have to make additional configuration
> setting in my header files? What can I do to work around the problem, I have
> to fix the warning, otherwise I cannot compile the code.

You can of course edit the code to silence the warning. I'll fix this in my
end by letting the 'excess' variable be a size_t type since it only needs to
hold a value up to BUFSIZE big (which is 16K).

> But I think there is a general problem with the signature of
> Curl_read_rewind. On 32-bit platforms size_t is of type 'unsigned integer'
> and cannot hold the data from an '__int64'.

In this case it can, since very few bits if the 64bit value is used... :-)

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2006-12-05