From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30398 invoked by alias); 18 Jul 2005 12:24:43 -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 30379 invoked by uid 22791); 18 Jul 2005 12:24:36 -0000 Received: from smtp-101-monday.noc.nerim.net (HELO mallaury.nerim.net) (62.4.17.101) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Mon, 18 Jul 2005 12:24:36 +0000 Received: from uniton.integrable-solutions.net (gdr.net1.nerim.net [62.212.99.186]) by mallaury.nerim.net (Postfix) with ESMTP id 92B554F3CC; Mon, 18 Jul 2005 14:23:57 +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 j6ICN8pI002318; Mon, 18 Jul 2005 14:23:08 +0200 Received: (from gdr@localhost) by uniton.integrable-solutions.net (8.12.10/8.12.10/Submit) id j6ICN8NS002317; Mon, 18 Jul 2005 14:23:08 +0200 To: Paul Schlie Cc: Mark Mitchell , Daniel Berlin , "D. Hugh Redelmeier" , Subject: Re: volatile semantics References: From: Gabriel Dos Reis In-Reply-To: Date: Mon, 18 Jul 2005 12:24:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2005-07/txt/msg00770.txt.bz2 Paul Schlie writes: [...] | > | With all due respect, unless there is an explicit reference in the standard | > | to contradict it's clearly stated requirement that an object's qualified | > | lvalue ("locator value") designates the object being referenced, all | > | interpretations to the contrary are at best presumptuous, regardless of | > | whether or not it's generalized behavior may be indeterminate. | > | | > | (but regardless, at least things are successively approximating "correct") | > | > I don't understand what you mean here. Are you seriously suggesting | > that | > | > int main(void) { | > const int x = 4; | > *(int*)&x = 3; | > } | > | > is well-defined? | | Actually yes, I believe it's well defined that: [#5] If an attempt is made to modify an object defined with a const-qualified type through use of an lvalue with non- const-qualified type, the behavior is undefined. If an attempt is made to refer to an object defined with a volatile-qualified type through use of an lvalue with non- volatile-qualified type, the behavior is undefined.113) -- Gaby