-qrestrict

Pragma equivalent

None.

Purpose

Specifying this option is equivalent to adding the restrict keyword to the pointer parameters within all functions, except that you do not need to modify the source file.

Syntax

Read syntax diagramSkip visual syntax diagram
        .-norestrict-.   
>>- -q--+-restrict---+-----------------------------------------><

Defaults

-qnorestrict. It means no function pointer parameters are restricted, unless you specify the restrict attribute in the source file.

Usage

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.

Note: 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


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