This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/33048] New: Warn on incorrect __attribute__((pure)), __attribute__((const))
- From: "ed at catmur dot co dot uk" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Aug 2007 17:49:52 -0000
- Subject: [Bug c/33048] New: Warn on incorrect __attribute__((pure)), __attribute__((const))
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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