From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23902 invoked by alias); 4 Feb 2008 22:14:50 -0000 Received: (qmail 23771 invoked by uid 48); 4 Feb 2008 22:14:07 -0000 Date: Mon, 04 Feb 2008 22:14:00 -0000 Message-ID: <20080204221407.23770.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c/35069] Casting from a volatile type to a non-volatile type should cause a warning In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "gcc-david at tulloh dot id dot au" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-02/txt/msg00462.txt.bz2 ------- Comment #2 from gcc-david at tulloh dot id dot au 2008-02-04 22:14 ------- Yes, I didn't provide any context. I believe that this warning should apply any time you are working with volatile variables. A truncated real world example (kind of, real world debugging). volatile static uint8_t OutputBuffer[4]; int16_t main(void) { while(1) { *(uint16_t *)(OutputBuffer)++; } } ISR(PCINT0_vect) { implement software SPI interface, transmit OutputBuffer in reverse byte order. } -- gcc-david at tulloh dot id dot au changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |UNCONFIRMED Resolution|INVALID | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35069