From: Tom Rini Date: Sat, 28 Nov 2015 08:04:40 -0500 Subject: [U-Boot] [PATCH 1/4] eth-raw-os.c: Add cast to bind(2) call Message-ID: <1448715883-14099-1-git-send-email-trini@konsulko.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de With more recent gcc versions we otherwise get an error like: note: expected 'const struct sockaddr *' but argument is of type 'struct sockaddr_in *' and the common solution here is to cast, rather than re-work the code. Cc: Joe Hershberger Cc: Simon Glass Signed-off-by: Tom Rini --- arch/sandbox/cpu/eth-raw-os.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/sandbox/cpu/eth-raw-os.c b/arch/sandbox/cpu/eth-raw-os.c index b76a731..5df01ba 100644 --- a/arch/sandbox/cpu/eth-raw-os.c +++ b/arch/sandbox/cpu/eth-raw-os.c @@ -194,7 +194,8 @@ int sandbox_eth_raw_os_send(void *packet, int length, addr.sin_family = AF_INET; addr.sin_port = udph->source; addr.sin_addr.s_addr = iph->saddr; - retval = bind(priv->local_bind_sd, &addr, sizeof(addr)); + retval = bind(priv->local_bind_sd, (struct sockaddr *)&addr, + sizeof(addr)); if (retval < 0) printf("Failed to bind: %d %s\n", errno, strerror(errno)); -- 2.6.2