cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: VC9 libcurl compiler warnings (64 bit only)

From: Adam Light <aclight_at_gmail.com>
Date: Mon, 30 Aug 2010 16:36:49 -0700

There hasn't been any activity on this thread for a while now, but I
just checked the latest code in the git repository and the compiler
warnings mentioned below are still there. There's also a new warning
(see bottom).

[Regarding This was regarding .\connect.c(1109) : warning C4244: '=' :
conversion from 'curl_socket_t' to 'long', possible loss of data.]:
On Fri, Jul 30, 2010 at 2:27 PM, Daniel Stenberg <daniel_at_haxx.se> wrote:
> On Sat, 24 Jul 2010, Adam Light wrote:
>
>> So SOCKET is a 64 bit type in 64 bit windows.
>
> Ouch. I've started out now by documenting this properly where this most
> notably might hurt users. I'll have to ponder a bit on how we adapt to this
> fact the best way, and if we may have other bugs internally due to this
> anomaly.

Since this seems like it could cause a crash, it would be good to get
it fixed. Is there anything I can do to help out here?

[Regarding .\file.c(556) : warning C4267: 'function' : conversion from
'size_t' to 'unsigned int', possible loss of data]:
> I see. The problem is of course that we don't have a proper define for what
> type read() wants so we can't typecast to anything sensible... And we can't
> seem to be using the RECV_TYPE_ARG3 either as for some reason the Windows
> recv() function doesn't use the same type for the length argument as read()
> (signed int vs unsigned int).
>
> I don't have a good fix for this warning just now. :-/

The new warning is:
.\gopher.c(144) : warning C4267: '=' : conversion from 'size_t' to
'int', possible loss of data. The code is:
  j = strlen(newp);

We get this warning because strlen() returns a size_t, but j is an integer.

Adam
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-08-31