cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: yangtse: curl/docs/examples 10-at-a-time.c, 1.7, 1.8 anyauthput.c, 1.6, 1.7 fopen.c, 1.11, 1.12 ftpuploadresume.c, 1.4, 1.5

From: Gisle Vanem <gvanem_at_broadpark.no>
Date: Mon, 01 Sep 2008 23:11:21 +0200

"Yang Tse" <yangsita_at_gmail.com> wrote:

>> I know. Hence my suggestion to use 'ULONG_PTR' to reduce the
>> #ifdef clutter.
>
> 'long' is still 4 bytes wide under _WIN64 even when void pointers are
> 8 bytes wide. So maybe what you are suggesting is doing the following

I wasn't talking about 'long', but 'LONG_PTR'. Look in <BaseTsd.h> in
your SDK (all win-compilers should have this):

#if defined(_WIN64)
..
    typedef __int64 LONG_PTR, *PLONG_PTR;
#else
..
    typedef _W64 long LONG_PTR, *PLONG_PTR;
#endif

Note the '_W64' is some magic to generated appropriate warning
when building with 'cl -Wp64'.

Building with '-Wp64' option on Visual Studio 2008 (MSVC 9) this does
in fact generate some warnings. I've not dug into the sources to verify
if these are harmful on Win64 (and I cannot try since i'm stuck with a
x86 cpu).

Here are the warnings:

.\ftp.c(719) : warning C4267: '+=' : conversion from 'size_t' to 'int', possible loss of data
.\telnet.c(1274) : warning C4312: 'type cast' : conversion from 'int' to 'HANDLE' of greater size
.\file.c(543) : warning C4267: 'function' : conversion from 'size_t' to 'unsigned int', possible loss of data
.\connect.c(1006) : warning C4244: '=' : conversion from 'curl_socket_t' to 'long', possible loss of data
.\tftp.c(217) : warning C4244: '=' : conversion from 'time_t' to 'int', possible loss of data
.\tftp.c(224) : warning C4244: '=' : conversion from 'time_t' to 'int', possible loss of data
.\tftp.c(241) : warning C4244: '=' : conversion from 'time_t' to 'int', possible loss of data
.\tftp.c(251) : warning C4244: '=' : conversion from 'time_t' to 'int', possible loss of data
.\socks.c(502) : warning C4267: '+=' : conversion from 'size_t' to 'int', possible loss of data
.\socks.c(505) : warning C4267: '+=' : conversion from 'size_t' to 'int', possible loss of data

--gv
Received on 2008-09-01