cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Minor patch to remove a couple of msvc compiler warnings

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 14 Nov 2005 08:49:10 +0100 (CET)

On Mon, 14 Nov 2005, Yang Tse wrote:

> The first patch adds an explicit cast when calling function 'sendto' in
> tftp.c

> + sbytes = sendto(state->sockfd, (char *)&state->spacket,
> + sbytes, 0,
> state->conn->ip_addr->ai_addr,
> state->conn->ip_addr->ai_addrlen);

Sorry, but as Albert Chin pointed out, all these socket functions are not that
easily typecasted and that's actually the reason for quite a few remaining
compiler warnings on several platforms.

Old unixes and Microsoft often agree on the types for arguments to functions
such as sendto() and others, while modern unixes and the Single Unix
Specification have a different set. See the sendto() definition for example:

  http://www.opengroup.org/onlinepubs/007908799/xns/sendto.html

If we are to fix this warning, we must introduce a define or macro for the
arguments' types and typecast to them and thus have them set differently
depending on what platform we build on/for.

> +; DESCRIPTION 'curl libcurl - http://curl.haxx.se'

I applied and committed this patch!

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2005-11-14