From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9099 invoked from network); 19 Feb 2004 10:33:42 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 19 Feb 2004 10:33:42 -0000 Received: (qmail 11283 invoked by alias); 19 Feb 2004 10:33:34 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 19446 Received: (qmail 11229 invoked from network); 19 Feb 2004 10:33:34 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 19 Feb 2004 10:33:34 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [62.189.58.19] by sunsite.dk (MessageWall 1.0.8) with SMTP; 19 Feb 2004 10:33:33 -0000 Received: from MAILSWEEPER01.csr.com (mailhost1.csr.com [62.189.183.235]) by lhuumrelay3.lnd.ops.eu.uu.net (8.11.0/8.11.0) with ESMTP id i1JAXXv13698 for ; Thu, 19 Feb 2004 10:33:33 GMT Received: from EXCHANGE02.csr.com (unverified [192.168.137.45]) by MAILSWEEPER01.csr.com (Content Technologies SMTPRS 4.3.12) with ESMTP id for ; Thu, 19 Feb 2004 10:33:15 +0000 Received: from csr.com ([192.168.144.127]) by EXCHANGE02.csr.com with Microsoft SMTPSVC(5.0.2195.5329); Thu, 19 Feb 2004 10:34:35 +0000 To: zsh-workers@sunsite.dk (Zsh hackers list) Subject: Re: Strict-aliasing warnings In-reply-to: "Wayne Davison"'s message of "Thu, 19 Feb 2004 02:20:29 PST." <20040219102029.GB26450@blorf.net> Date: Thu, 19 Feb 2004 10:33:32 +0000 Message-ID: <1728.1077186812@csr.com> From: Peter Stephenson X-OriginalArrivalTime: 19 Feb 2004 10:34:35.0963 (UTC) FILETIME=[F83AA0B0:01C3F6D3] Wayne Davison wrote: > > --zYM0uCDKw75PZbzx > Content-Type: text/plain; charset=us-ascii > Content-Disposition: inline > > I'm using a version of gcc 3.3 to compile zsh, and it is spitting out a > bunch of warnings like this: > > warning: dereferencing type-punned pointer will break strict-aliasing rules > > The attached patch silences these warnings, but I'm not sure if this is > the right way to fix these. Seems unlikely that changing a (HashNode) cast to (void *) when the formal argument really is a HashNode would improve things. The warning is highly obscure but my guess is it's worried because it doesn't know that the type we're looking at really does look like a HashNode. Or maybe it's more sinister than that and it's saying it may actually break HashNode's which are really pointers to other nodes in the same format. We could of course rewrite the code to embed real HashNode's at the front of anything which goes into the hasher. -- Peter Stephenson Software Engineer CSR Ltd., Science Park, Milton Road, Cambridge, CB4 0WH, UK Tel: +44 (0)1223 692070 ********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com **********************************************************************