From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28721 invoked by alias); 24 Sep 2011 15:10:02 -0000 Received: (qmail 28692 invoked by uid 22791); 24 Sep 2011 15:10:01 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from rio.cs.utah.edu (HELO mail-svr1.cs.utah.edu) (155.98.64.241) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 24 Sep 2011 15:09:45 +0000 Received: from mail-svr1.cs.utah.edu (localhost [127.0.0.1]) by mail-svr1.cs.utah.edu (Postfix) with ESMTP id 2168F6500CF; Sat, 24 Sep 2011 09:09:44 -0600 (MDT) Received: from gamow.cs.utah.edu (gamow.cs.utah.edu [155.98.66.244]) by mail-svr1.cs.utah.edu (Postfix) with ESMTP; Sat, 24 Sep 2011 09:09:44 -0600 (MDT) Date: Sat, 24 Sep 2011 15:10:00 -0000 From: John Regehr To: David Brown cc: gcc@gcc.gnu.org Subject: Re: Volatile qualification on pointer and data In-Reply-To: Message-ID: References: <4E7A3209.10508@gjlay.de> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2011-09/txt/msg00276.txt.bz2 > What can't make sense is a /static/ "volatile const" which is /defined/ > locally, rather than just declared. The code in question sounds well-defined (but probably poor style) to me. It is never OK to access a qualified object through an unqualified pointer, but my understanding is that accessing an unqualified object through a qualified pointer is well-defined and that the usual qualifier rules apply to that access. David, is your "can't make sense" backed up by a standard? There is no "lying to the compiler", there is only conforming and non-conforming code. John