From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11060 invoked by alias); 11 Aug 2007 17:50:02 -0000 Received: (qmail 9114 invoked by uid 48); 11 Aug 2007 17:49:52 -0000 Date: Sat, 11 Aug 2007 17:50:00 -0000 Subject: [Bug c/33048] New: Warn on incorrect __attribute__((pure)), __attribute__((const)) X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "ed at catmur dot co dot uk" 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/msg00767.txt.bz2 gcc should warn when a function that is declared with __attribute__((pure)) or __attribute__((const)) is defined in a way that appears to break those guarantees. i.e. an __attribute__((const)) function should not be allowed to dereference pointers or call non-__attribute__((const)) functions (except perhaps __attribute__((pure)) functions with pointer arguments only allowed to be references to local variables?); __attribute__((pure)) similarly. -- Summary: Warn on incorrect __attribute__((pure)), __attribute__((const)) Product: gcc Version: 4.2.0 Status: UNCONFIRMED Severity: enhancement Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: ed at catmur dot co dot uk http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33048