From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32018 invoked by alias); 2 Jul 2005 23:45:56 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 32002 invoked by uid 48); 2 Jul 2005 23:45:52 -0000 Date: Sat, 02 Jul 2005 23:45:00 -0000 Message-ID: <20050702234552.32000.qmail@sourceware.org> From: "falk at debian dot org" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20050702164323.22278.olivier.baudron@m4x.org> References: <20050702164323.22278.olivier.baudron@m4x.org> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c/22278] gcc -O2 discards cast to volatile X-Bugzilla-Reason: CC X-SW-Source: 2005-07/txt/msg00228.txt.bz2 List-Id: ------- Additional Comments From falk at debian dot org 2005-07-02 23:45 ------- (In reply to comment #19) > How about this? > > int foo; > *(volatile int*) (&foo); > > In other words, why should the compiler bother at all with the qualifiers of > what the pointer "really" points to? Because the standard says so. As Nathan Sidwell explains in the thread linked above, it would be both pretty difficult to define the language extension you want semantically clean, and to implement it in gcc. So nobody tried yet. (Giving a warning would probably be less difficult to implement, unfortunately nobody tried either.) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22278