From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20652 invoked by alias); 30 Apr 2008 13:42:37 -0000 Received: (qmail 20642 invoked by uid 22791); 30 Apr 2008 13:42:37 -0000 X-Spam-Check-By: sourceware.org Received: from exprod6og101.obsmtp.com (HELO exprod6og101.obsmtp.com) (64.18.1.181) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 30 Apr 2008 13:42:15 +0000 Received: from source ([192.150.11.134]) by exprod6ob101.postini.com ([64.18.5.12]) with SMTP; Wed, 30 Apr 2008 06:41:52 PDT Received: from inner-relay-1.corp.adobe.com ([153.32.1.51]) by outbound-smtp-1.corp.adobe.com (8.12.10/8.12.10) with ESMTP id m3UDcmG3007833; Wed, 30 Apr 2008 06:38:48 -0700 (PDT) Received: from apacmail.pac.adobe.com (apacmail.pac.adobe.com [130.248.36.99]) by inner-relay-1.corp.adobe.com (8.12.10/8.12.10) with ESMTP id m3UDfmI0013653; Wed, 30 Apr 2008 06:41:49 -0700 (PDT) Received: from namailgen.corp.adobe.com ([10.8.192.91]) by apacmail.pac.adobe.com with Microsoft SMTPSVC(6.0.3790.1830); Wed, 30 Apr 2008 22:41:48 +0900 Received: from 10.32.16.88 ([10.32.16.88]) by namailgen.corp.adobe.com ([10.8.192.91]) via Exchange Front-End Server namailhost.corp.adobe.com ([10.8.192.72]) with Microsoft Exchange Server HTTP-DAV ; Wed, 30 Apr 2008 13:41:46 +0000 User-Agent: Microsoft-Entourage/12.1.0.080305 Date: Wed, 30 Apr 2008 14:49:00 -0000 Subject: Re: strict aliasing: how to swap pointers From: John Love-Jensen To: Evan Jones CC: GCC-help Message-ID: In-Reply-To: <4818746C.5040106@mit.edu> Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2008-04/txt/msg00411.txt.bz2 Hi Evan, > What is confusing to me about the strict aliasing warning is that I > thought GCC must conservatively assume that a void* pointer can point to > anything, since T* is convertible to void*. Correct. > Hence, it seems to me that casting a T** to void** should not result in a > type-punning warning. void** is not void*. HTH, --Eljay