attributes.h File Reference

Compiler attribute macros. More...

## Macros

#define | XAPIAN_CONST_FUNCTION
| A function which does not examine any values except its arguments and has no effects except its return value. More...
#define | XAPIAN_PURE_FUNCTION
| Like XAPIAN_CONST_FUNCTION, but such a function can also examine global memory, perhaps via pointer or reference parameters.

## Detailed Description

Compiler attribute macros.

## Macro Definition Documentation

#define XAPIAN_CONST_FUNCTION

A function which does not examine any values except its arguments and has no effects except its return value.

This means the compiler can perform CSE (common subexpression elimination) on calls to such a function with the same arguments, and also completely eliminate calls to this function when the return value isn't used.