next up previous
Next: The Halting Problem Up: Limitations and Future Work Previous: Static Properties of Functions

Pointers

Our method already handles pointers in a basic way. Nevertheless, doing a more comprehensive pointer analysis (for instance, using the method described in [12]) might yield information that can be used to obtain more optimistic results. For instance, consider the example in figure 4. When analyzed using our existing method, the function square will be annotated as unreusable because there is a modification to a location pointed by a pointer (ip). However, if we consider that the pointer ip points only to a local variable within the function, square is really a const function.

Another aspect of pointers that we have not dealt with is the concept of function pointers. Currently we handle only function calls using the symbol of the functions being called. Any calls through function calls cause the current function to be unreusable. With pointer analysis, it might be possible in some cases to determine the identity of the function called by way of a pointer.



Indrayana Rustandi 2003-12-04