From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18424 invoked by alias); 8 Aug 2008 19:49:18 -0000 Received: (qmail 16911 invoked by uid 48); 8 Aug 2008 19:47:58 -0000 Date: Fri, 08 Aug 2008 19:49:00 -0000 Message-ID: <20080808194758.16910.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c/37064] missing warning on pure function with side-effects In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "sebor at roguewave dot com" 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-08/txt/msg00567.txt.bz2 ------- Comment #1 from sebor at roguewave dot com 2008-08-08 19:47 ------- Similarly, functions declared with the const attribute such as f1() in the test case below that violate the compiler's assumptions should be diagnosed: $ cat -n t.C && g++ -c -O2 -Wall -W t.C 1 extern int i; 2 int f1 () __attribute ((const)); 3 int f1 () 4 { 5 return i; 6 } 7 -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37064