From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5043 invoked by alias); 14 Nov 2004 21:37:27 -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 5035 invoked by uid 48); 14 Nov 2004 21:37:24 -0000 Date: Sun, 14 Nov 2004 21:37:00 -0000 From: "kazu at cs dot umass dot edu" To: gcc-bugs@gcc.gnu.org Message-ID: <20041114213723.18487.kazu@cs.umass.edu> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug tree-optimization/18487] New: Warnings for pure and const functions that are not actually pure or const X-Bugzilla-Reason: CC X-SW-Source: 2004-11/txt/msg01778.txt.bz2 List-Id: It would be nice if GCC can issue warnings for pure or const functions that are not actually pure or const. int foo (int) __attribute__ ((pure)); int bar (int) __attribute__ ((const)); int g; int foo (int a) { g = a; /* A pure function is not supposed to write to memory. */ return 0; } int bar (int a) { return g; /* A const function is not supposed to read memory. */ } -- Summary: Warnings for pure and const functions that are not actually pure or const Product: gcc Version: unknown Status: UNCONFIRMED Severity: enhancement Priority: P2 Component: tree-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: kazu at cs dot umass dot edu CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18487