From: Wolfgang Denk Date: Fri, 11 Sep 2009 07:05:32 +0000 (+0200) Subject: net/bootp.c: fix compile warning X-Git-Tag: v2010.09-rc1~28^2~7^2~42^2~120 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e35c73d7e19e6ea45efcaf807736277afee9c7d1;p=u-boot net/bootp.c: fix compile warning Fix warning: bootp.c:695: warning: dereferencing type-punned pointer will break strict-aliasing rules Signed-off-by: Wolfgang Denk Cc: Ben Warren --- diff --git a/net/bootp.c b/net/bootp.c index 0799ae2b0f..309385278f 100644 --- a/net/bootp.c +++ b/net/bootp.c @@ -683,6 +683,9 @@ static void DhcpOptionsProcess (uchar * popt, Bootp_t *bp) { uchar *end = popt + BOOTP_HDR_SIZE; int oplen, size; +#if defined(CONFIG_CMD_SNTP) && defined(CONFIG_BOOTP_TIMEOFFSET) + int *to_ptr; +#endif while (popt < end && *popt != 0xff) { oplen = *(popt + 1); @@ -692,7 +695,8 @@ static void DhcpOptionsProcess (uchar * popt, Bootp_t *bp) break; #if defined(CONFIG_CMD_SNTP) && defined(CONFIG_BOOTP_TIMEOFFSET) case 2: /* Time offset */ - NetCopyLong ((ulong *)&NetTimeOffset, (ulong *) (popt + 2)); + to_ptr = &NetTimeOffset; + NetCopyLong ((ulong *)to_ptr, (ulong *)(popt + 2)); NetTimeOffset = ntohl (NetTimeOffset); break; #endif