-qrestrict

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

Read syntax diagramSkip visual syntax diagram
        .-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.

Notes:
  • 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



Voice your opinion on getting help information Ask IBM compiler experts a technical question in the IBM XL compilers forum Reach out to us