-qrestrict
Category
Pragma equivalent
None.
Purpose
Specifying this option is equivalent to adding the restrict keyword to the pointer parameters within the specified functions, except that you do not need to modify the source file.
Syntax
.-norestrict-. >>- -q--+-restrict---+--+----------------------+--------------->< | .-:-------------. | | V | | '-=----function_name-+-'
Defaults
-qnorestrict. It means no function pointer parameters are restricted, unless you specify the restrict attribute in the source file.
Usage
If you do not specify the function_name, pointer parameters in all functions are treated as restrict. Otherwise, only those pointer parameters in the listed functions are treated as restrict.
function_name is a colon-separated list.
Using this option can improve the performance of your application, but incorrectly asserting this pointer restriction might cause the compiler to generate incorrect code based on the false assumption. If the application works correctly when recompiled without -qrestrict, the assertion might be false. In this case, this option should not be used.
- Using -qnokeyword=restrict has no impact on the -qrestrict option.
- If you specify both the -qalias=norestrict and -qrestrict options, -qalias=norestrict takes effect.
Predefined macros
None.
Examples
To compile myprogram.c, instructing the compiler to restrict the pointer access, enter:
xlc -qrestrict myprogram.c
Related information
- The restrict type qualifier in the XL C Language Reference.
- Keywords in the XL C Language Reference.
- -qkeyword
- -qalias