[Xapian-tickets] [Xapian] #151: Use function attributes to mark functions as "const" or "pure"

Xapian nobody at xapian.org
Thu Sep 22 07:01:57 BST 2022


#151: Use function attributes to mark functions as "const" or "pure"
-------------------------+-------------------------------
 Reporter:  Olly Betts   |             Owner:  Olly Betts
     Type:  enhancement  |            Status:  closed
 Priority:  normal       |         Milestone:  1.4.x
Component:  Other        |           Version:  SVN trunk
 Severity:  minor        |        Resolution:  fixed
 Keywords:               |        Blocked By:
 Blocking:               |  Operating System:  All
-------------------------+-------------------------------
Changes (by Olly Betts):

 * status:  assigned => closed
 * resolution:   => fixed

Comment:

 I think it makes most sense to close this at this point.

 We have macros to support specifying these attributes in a portable way so
 they work where supported and where not, and these macros are used in the
 most obvious places.

 There's likely always going to be scope to use them more, but in most
 places they'll make little or no difference.  In some places they'll make
 a significant difference (e.g. by allowing the compiler to realise it can
 apply CSE and only call a function once and reuse the result).  It's
 really these cases that matter.
-- 
Ticket URL: <https://trac.xapian.org/ticket/151#comment:15>
Xapian <https://xapian.org/>
Xapian


More information about the Xapian-tickets mailing list