Sun Studio 12: C++ User's Guide

B.2.4 #pragma does_not_write_global_data


#pragma does_not_write_global_data(funcname [, funcname])

This pragma asserts that the specified list of routines do not write global data directly or indirectly. This allows for better optimization of code around calls to such routines. In particular, assignment statements or stores could be moved around such calls.

This pragma is permitted only after the prototype for the specified functions are declared. If the assertion about global access is not true, then the behavior of the program is undefined.

For a more detailed explanation of how the pragma treats overloaded function names as arguments, see B.1.1 Overloaded Functions as Pragma Arguments.