| |||
| Home > Compiler-specific Features > Keywords and operators > __pure | |||
The __pure keyword asserts that a function
declaration is pure.
A function is pure only if:
the result depends exclusively on the values of its arguments
the function has no side effects.
__pure is a function qualifier. It affects
the type of a function.
This keyword has the function attribute equivalent __attribute__((const)).
A function that is declared as pure can have no side effects. For example, pure functions:
cannot call impure functions
cannot use global variables or dereference pointers, because the compiler assumes that the function does not access memory, except stack memory
must return the same value each time when called twice with the same parameters.
__pure in the Compiler User Guide
Placing ARM function qualifiers in the Compiler User Guide.