From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18680 invoked by alias); 16 Jul 2005 21:17:17 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 18660 invoked by uid 22791); 16 Jul 2005 21:17:13 -0000 Received: from smtp-106-saturday.nerim.net (HELO kraid.nerim.net) (62.4.16.106) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Sat, 16 Jul 2005 21:17:13 +0000 Received: from uniton.integrable-solutions.net (gdr.net1.nerim.net [62.212.99.186]) by kraid.nerim.net (Postfix) with ESMTP id 0E6F840E1E; Sat, 16 Jul 2005 23:17:10 +0200 (CEST) Received: from uniton.integrable-solutions.net (localhost [127.0.0.1]) by uniton.integrable-solutions.net (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id j6GLGLpI027299; Sat, 16 Jul 2005 23:16:21 +0200 Received: (from gdr@localhost) by uniton.integrable-solutions.net (8.12.10/8.12.10/Submit) id j6GLGLBr027298; Sat, 16 Jul 2005 23:16:21 +0200 To: Dale Johannesen Cc: Andrew Haley , "D. Hugh Redelmeier" , gcc@gcc.gnu.org, Nathan Sidwell , Mike Stump Subject: Re: volatile semantics References: <851D2CB0-93DF-4C49-A6A8-8895DB1A08F9@apple.com> <42778D99.7070904@codesourcery.com> <17113.17689.558864.411876@zapata.pink> From: Gabriel Dos Reis In-Reply-To: Date: Sat, 16 Jul 2005 21:17:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2005-07/txt/msg00681.txt.bz2 Dale Johannesen writes: | > the type of an object | > changes depending on how it is accessed. | | this also makes nonsense of gcc's implementation of type-based aliasing | rules. | | *((int *)&x) = 3 No. That one is specifically covered by the C and C++ standards (although they use different terminologies). C uses the notion of *effective type* to formulate the rule. [#6] The effective type of an object for an access to its stored value is the declared type of the object, if any.72) If a value is stored into an object having no declared type through an lvalue having a type that is not a character type, then the type of the lvalue becomes the effective type of the object for that access and for subsequent accesses that do not modify the stored value. If a value is copied into an object having no declared type using memcpy or memmove, or is copied as an array of character type, then the effective type of the modified object for that access and for subsequent accesses that do not modify the value is the effective type of the object from which the value is copied, if it has one. For all other accesses to an object having no declared type, the effective type of the object is simply the type of the lvalue used for the access. -- Gaby