From owner-freebsd-current@FreeBSD.ORG Wed Feb 18 11:04:19 2009 Return-Path: Delivered-To: current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C2371065672 for ; Wed, 18 Feb 2009 11:04:19 +0000 (UTC) (envelope-from andrew@areilly.bpa.nu) Received: from nschwmtas06p.mx.bigpond.com (nschwmtas06p.mx.bigpond.com [61.9.189.152]) by mx1.freebsd.org (Postfix) with ESMTP id 9A64E8FC18 for ; Wed, 18 Feb 2009 11:04:18 +0000 (UTC) (envelope-from andrew@areilly.bpa.nu) Received: from nschwotgx01p.mx.bigpond.com ([124.188.162.219]) by nschwmtas06p.mx.bigpond.com with ESMTP id <20090218110417.UMMD3101.nschwmtas06p.mx.bigpond.com@nschwotgx01p.mx.bigpond.com> for ; Wed, 18 Feb 2009 11:04:17 +0000 Received: from areilly.bpa.nu ([124.188.162.219]) by nschwotgx01p.mx.bigpond.com with ESMTP id <20090218110415.RDVR807.nschwotgx01p.mx.bigpond.com@areilly.bpa.nu> for ; Wed, 18 Feb 2009 11:04:15 +0000 Received: (qmail 13316 invoked by uid 501); 18 Feb 2009 11:04:02 -0000 Date: Wed, 18 Feb 2009 22:04:02 +1100 From: Andrew Reilly To: "M. Warner Losh" Message-ID: <20090218110402.GA13040@duncan.reilly.home> References: <20090218023328.227617302F@freebsd-current.sentex.ca> <20090217.203647.-1518647466.imp@bsdimp.com> <20090217.222152.-109416210.imp@bsdimp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090217.222152.-109416210.imp@bsdimp.com> User-Agent: Mutt/1.4.2.3i X-RPD-ScanID: Class unknown; VirusThreatLevel unknown, RefID str=0001.0A150205.499BEB2F.006A,ss=1,fgs=0 Cc: mips@FreeBSD.org, tinderbox@FreeBSD.org, current@FreeBSD.org Subject: Re: [head tinderbox] failure on mips/mips X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2009 11:04:19 -0000 On Tue, Feb 17, 2009 at 10:21:52PM -0700, M. Warner Losh wrote: > In message: <20090217.203647.-1518647466.imp@bsdimp.com> > "M. Warner Losh" writes: > : In message: <20090218023328.227617302F@freebsd-current.sentex.ca> > : FreeBSD Tinderbox writes: > : : /src/usr.sbin/bsnmpd/modules/snmp_mibII/../../../../contrib/bsnmp/snmp_mibII/mibII.c:1016: warning: cast increases required alignment of target type > The first one is: > > case RTM_IFINFO: > ifm = (struct if_msghdr *)rtm; > mib_extract_addrs(ifm->ifm_addrs, (u_char *)(ifm + 1), addrs); > if ((ifp = mib_find_if_sys(ifm->ifm_index)) == NULL) > break; > > rtm is of type struct rt_msghdr. This has an alignment requirement of > 4 on mips, at least on 32-bit mips (the biggest data element is a > u_long). struct if_msghdr has an alignment requirement of 8, because > time_t is int64_t on MIPS, which is 8-bytes in size. If the memory that rtm can be pointing to can be either a struct rt_msghdr or a struct if_msghdr, then shouldn't it really be pointing to a union of those two, and then the alignment will sort itself out? (As far as I know, that's the only way that C99 will guarantee that the right thing happens anyway, otherwise strict aliasing analysis would allow much worse badness to happen, potentially.) Not looked at the code myself. Perhaps there's a reason why that would be unworkable. Cheers, Andrew