The const function attribute allows you to tell the compiler that the function can safely be called fewer times than indicated in the source code. The language feature provides the programmer with an explicit way to help the compiler optimize code by indicating that the function does not examine any values except its arguments and has no effects except for its return value.
The const function attribute follows the general syntax for function attributes.
>>-__attribute__--((--+-const-----+--))------------------------>< '-__const__-'
The following kinds of functions should not be declared const:
See also #pragma isolated_call in XL C/C++ Compiler Reference.
Related References