From: Wolfgang Denk Date: Fri, 11 Sep 2009 11:18:18 +0200 Subject: [U-Boot] [PATCH] net/bootp.c: fix compile warning In-Reply-To: <1252660703-15596-1-git-send-email-wd@denx.de> References: <1252660703-15596-1-git-send-email-wd@denx.de> Message-ID: <1252660703-15596-2-git-send-email-wd@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Fix warning: bootp.c:695: warning: dereferencing type-punned pointer will break strict-aliasing rules Signed-off-by: Wolfgang Denk Cc: Ben Warren --- net/bootp.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/net/bootp.c b/net/bootp.c index 0799ae2..3093852 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 -- 1.6.0.6