Module Name: src
Committed By: christos
Date: Sun Aug 14 12:15:15 UTC 2011
Modified Files:
src/sbin/ifconfig: Makefile af_atalk.c
Log Message:
use memcpy to avoid strict aliasing warnings
To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sbin/ifconfig/Makefile
cvs rdiff -u -r1.17 -r1.18 src/sbin/ifconfig/af_atalk.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sbin/ifconfig/Makefile
diff -u src/sbin/ifconfig/Makefile:1.51 src/sbin/ifconfig/Makefile:1.52
--- src/sbin/ifconfig/Makefile:1.51 Tue Jun 21 22:49:43 2011
+++ src/sbin/ifconfig/Makefile Sun Aug 14 08:15:15 2011
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.51 2011/06/22 02:49:43 mrg Exp $
+# $NetBSD: Makefile,v 1.52 2011/08/14 12:15:15 christos Exp $
# @(#)Makefile 8.1 (Berkeley) 6/5/93
# when making a change to this file, please check if the change is
@@ -32,8 +32,3 @@
.endif
.include <bsd.prog.mk>
-
-# XXX
-.if ${HAVE_GCC} == 45
-COPTS.af_atalk.c+= -fno-strict-aliasing
-.endif
Index: src/sbin/ifconfig/af_atalk.c
diff -u src/sbin/ifconfig/af_atalk.c:1.17 src/sbin/ifconfig/af_atalk.c:1.18
--- src/sbin/ifconfig/af_atalk.c:1.17 Mon Dec 13 12:35:08 2010
+++ src/sbin/ifconfig/af_atalk.c Sun Aug 14 08:15:15 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: af_atalk.c,v 1.17 2010/12/13 17:35:08 pooka Exp $ */
+/* $NetBSD: af_atalk.c,v 1.18 2011/08/14 12:15:15 christos Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -31,7 +31,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: af_atalk.c,v 1.17 2010/12/13 17:35:08 pooka Exp $");
+__RCSID("$NetBSD: af_atalk.c,v 1.18 2011/08/14 12:15:15 christos Exp $");
#endif /* not lint */
#include <sys/param.h>
@@ -150,7 +150,7 @@
if (ntohs(nr.nr_firstnet) > ntohs(sat->sat_addr.s_net) ||
ntohs(nr.nr_lastnet) < ntohs(sat->sat_addr.s_net))
errx(EXIT_FAILURE, "AppleTalk address is not in range");
- *((struct netrange *)&sat->sat_zero) = nr;
+ memcpy(&sat->sat_zero, &nr, sizeof(nr));
/* Copy the new address to a temporary input environment */