From owner-freebsd-current@FreeBSD.ORG Thu Jan 27 13:54:59 2005 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 12FBB16A4CE for ; Thu, 27 Jan 2005 13:54:59 +0000 (GMT) Received: from fafoe.narf.at (chello084113209090.6.14.vie.surfer.at [84.113.209.90]) by mx1.FreeBSD.org (Postfix) with ESMTP id 840F843D5D for ; Thu, 27 Jan 2005 13:54:58 +0000 (GMT) (envelope-from stefan@fafoe.narf.at) Received: from wombat.fafoe.narf.at (wombat.fafoe.narf.at [192.168.1.42]) by fafoe.narf.at (Postfix) with ESMTP id ECD7D40A9; Thu, 27 Jan 2005 14:54:55 +0100 (CET) Received: by wombat.fafoe.narf.at (Postfix, from userid 1001) id EFDC016B; Thu, 27 Jan 2005 14:54:53 +0100 (CET) Date: Thu, 27 Jan 2005 14:54:53 +0100 From: Stefan Farfeleder To: Scott Long Message-ID: <20050127135452.GU21084@wombat.fafoe.narf.at> Mail-Followup-To: Scott Long , Divacky Roman , current@freebsd.org References: <20050127113906.GA98285@stud.fit.vutbr.cz> <41F8D54F.9090802@samsco.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41F8D54F.9090802@samsco.org> User-Agent: Mutt/1.5.6i cc: Divacky Roman cc: current@freebsd.org Subject: Re: recent current kernel compile failure X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 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: Thu, 27 Jan 2005 13:54:59 -0000 On Thu, Jan 27, 2005 at 04:49:35AM -0700, Scott Long wrote: > Divacky Roman wrote: > > >hi > > > >recent current with CFLAGS=-O2: > > > >../dev/amr/amr_pci.c > >/usr/src/sys/modules/amr/../../dev/amr/amr_pci.c: In function > >`amr_setup_mbox': > >/usr/src/sys/modules/amr/../../dev/amr/amr_pci.c:605: warning: > >dereferencing > >type-punned pointer will break strict-aliasing rules > > > >would be nice to have this repaired > > > >roman > > We don't support compiling with -fstrict-aliasing. The correct solution > is likely to change the type of 'p' and add a bunch of casts. Not very > pretty, but I guess no worse than the horribly non-informative gcc > message that is generated here. This patch should be better: Index: amr_pci.c =================================================================== RCS file: /b/ncvs/src/sys/dev/amr/amr_pci.c,v retrieving revision 1.27 diff -I.svn -u -r1.27 amr_pci.c --- amr_pci.c 23 Jan 2005 23:25:41 -0000 1.27 +++ amr_pci.c 27 Jan 2005 13:51:27 -0000 @@ -574,7 +574,7 @@ amr_setup_mbox(struct amr_softc *sc) { int error; - u_int8_t *p; + void *p; debug_called(1); @@ -602,7 +602,7 @@ * Allocate the mailbox structure and permanently map it into * controller-visible space. */ - error = bus_dmamem_alloc(sc->amr_mailbox_dmat, (void **)&p, BUS_DMA_NOWAIT, + error = bus_dmamem_alloc(sc->amr_mailbox_dmat, &p, BUS_DMA_NOWAIT, &sc->amr_mailbox_dmamap); if (error) { device_printf(sc->amr_dev, "can't allocate mailbox memory\n"); @@ -614,8 +614,8 @@ * Conventional mailbox is inside the mailbox64 region. */ bzero(p, sizeof(struct amr_mailbox64)); - sc->amr_mailbox64 = (struct amr_mailbox64 *)(p + 12); - sc->amr_mailbox = (struct amr_mailbox *)(p + 16); + sc->amr_mailbox64 = (struct amr_mailbox64 *)((char *)p + 12); + sc->amr_mailbox = (struct amr_mailbox *)((char *)p + 16); return(0); } Stefan