From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29706 invoked by alias); 13 Aug 2007 05:41:11 -0000 Received: (qmail 27621 invoked by uid 48); 13 Aug 2007 05:40:54 -0000 Date: Mon, 13 Aug 2007 05:41:00 -0000 Message-ID: <20070813054054.27620.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug tree-optimization/18487] Warnings for pure and const functions that are not actually pure or const In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "gnu at behdad dot org" 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: 2007-08/txt/msg00839.txt.bz2 ------- Comment #5 from gnu at behdad dot org 2007-08-13 05:40 ------- (In reply to comment #2) > If the compiler could tell whether you were right or not in all cases, you > wouldn't need the attributes in the first place. This is not completely true though: the compiler cannot tell by just seeing the prototype. So, even if the compiler could recognize all pure and const functions when compiling them, that doesn't help when you need to mark the prototypes of those functions as pure/const to help the compiler compiling other programs using them. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18487