cURL / Mailing Lists / curl-library / Single Mail


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

From: Daniel Stenberg <>
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:

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 -'

I applied and committed this patch!

  Commercial curl and libcurl Technical Support:
Received on 2005-11-14