From owner-freebsd-net@FreeBSD.ORG Thu Jun 6 23:34:45 2013 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5EEB66CA; Thu, 6 Jun 2013 23:34:45 +0000 (UTC) (envelope-from mdounin@mdounin.ru) Received: from ns2.mdounin.ru (ns2.mdounin.ru [88.198.19.180]) by mx1.freebsd.org (Postfix) with ESMTP id 2473F1C71; Thu, 6 Jun 2013 23:34:44 +0000 (UTC) Received: from mdounin.ru (ns2.mdounin.ru [88.198.19.180]) by ns2.mdounin.ru (Postfix) with ESMTP id 2C35FED8C00; Fri, 7 Jun 2013 03:29:25 +0400 (MSK) Date: Fri, 7 Jun 2013 03:29:25 +0400 From: Maxim Dounin To: Matthias Andree Subject: Re: IN6_IS_ADDR_* macros use invalid type punning? Message-ID: <20130606232925.GU72282@mdounin.ru> References: <51B0EFC2.1020406@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <51B0EFC2.1020406@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-net@freebsd.org X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jun 2013 23:34:45 -0000 Hello! On Thu, Jun 06, 2013 at 10:23:30PM +0200, Matthias Andree wrote: > I am just staring at gcc 4.8 warnings when compiling the try.c code > shown below: [...] > try.c:9:5: warning: dereferencing type-punned pointer will break > strict-aliasing rules [-Wstrict-aliasing] > int r = IN6_IS_ADDR_V4MAPPED((&sin6.sin6_addr)); > ^ > try.c:9:5: warning: dereferencing type-punned pointer will break > strict-aliasing rules [-Wstrict-aliasing] [...] > Can we get these fixed in a reasonable timeframe? > > To whom, or where, would I submit a patch for all the macros so that it > actually gets committed to HEAD and MFC'd to /9 and /8? Gleb already committed a fix for this 16 months ago (unfortunately, correct patch description was lost in transit): http://svnweb.freebsd.org/base?view=revision&revision=230584 Probably it's a good idea to MFC the fix. -- Maxim Dounin http://nginx.org/en/donation.html