Ticket #151 (assigned enhancement)
Use function attributes to mark functions as "const", "pure", and "nothrow"
| Reported by: | olly | Owned by: | olly |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.1.1 |
| Component: | Other | Version: | SVN trunk |
| Severity: | minor | Keywords: | |
| Cc: | Blocked By: | ||
| Operating System: | All | Blocking: |
Description (last modified by richard) (diff)
GCC allows functions to be annotate with attribute((const)) if they "do not examine any values except their arguments, and have no effects except the return value", which allows the compiler to use CSE to eliminate calls to them with identical arguments. This would probably be very useful for Xapian::Unicode::get_category() for example.
URL: http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Function-Attributes.html#Function-Attributes
Change History
Note: See
TracTickets for help on using
tickets.
