#pragma no_side_effect(name[,name...]) |
Use no_side_effect to indicate that a function does not change any persistent state. The pragma declares that the named functions have no side effects of any kind. This means that the functions return result values that depend on the passed arguments only. In addition, the functions and their called descendants:
Do not access for reading or writing any part of the program state visible in the caller at the point of the call.
Do not perform I/O.
Do not change any part of the program state not visible at the point of the call.
The compiler can use this information when doing optimizations.
If the function does have side effects, the results of executing a program which calls this function are undefined.
The name argument specifies the name of a function within the current translation unit. The pragma must be in the same scope as the function and must appear after the function declaration. The pragma must be before the function definition.
For a more detailed explanation of how the pragma treats overloaded function names as arguments, see B.1.1 Overloaded Functions as Pragma Arguments.