This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/33048] New: Warn on incorrect __attribute__((pure)), __attribute__((const))


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]