Sun Studio 12: C User's Guide

B.2.136 -xrestrict[=f]

(SPARC) Treats pointer-valued function parameters as restricted pointers . f is %all, %none, or a comma-separated list of one or more function names: {%all|%none|fn[,fn...]}.

If a function list is specified with this option, pointer parameters in the specified functions are treated as restricted; if -xrestrict=%all is specified, all pointer parameters in the entire C file are treated as restricted. Refer to 3.8.2 Restricted Pointers, for more information.

This command-line option can be used on its own, but it is best used with optimization. For example, the command:


%cc -xO3 -xrestrict=%all prog.c

treats all pointer parameters in the file prog.c as restricted pointers. The command:


%cc -xO3 -xrestrict=agc prog.c

treats all pointer parameters in the function agc in the file prog.c as restricted pointers.

The default is %none; specifying -xrestrict is equivalent to specifying -xrestrict=%all.