restrict
Sign in to saveIn the C programming language, restrict is a type qualifier that can be applied to a pointer to hint to the compiler that for the lifetime of that pointer, no other pointer will be used to access the same pointed-to object. This limits the effects of pointer aliasing, which can allow the compiler to make optimizations (such as vectorization) that would not otherwise be possible. Undefined behaviour results if the declaration of intent is not followed and the object is accessed by an independent pointer.
In the Vinony graph
Vinony's link graph records 11 inbound references to restrict, and connects out to undefined behavior, C and C++.
It is catalogued under the topic C (programming language).
Vinony links it to 5 Wikipedia language editions.
~5 min read
Encyclopedic overview
5 sectionsContents
- Optimization
- Support by C++ compilers
- Compiler warnings
- References
- External links
In the C programming language, restrict is a type qualifier that can be applied to a pointer to hint to the compiler that for the lifetime of that pointer, no other pointer will be used to access the same pointed-to object. This limits the effects of pointer aliasing, which can allow the compiler to make optimizations (such as vectorization) that would not otherwise be possible. Undefined behaviour results if the declaration of intent is not followed and the object is accessed by an independent pointer.
The restrict keyword was introduced by the C99 standard. Despite C++ supporting most features of C, restrict is not included in standard C++.
Excerpted from Wikipedia’s “restrict” article, available under the CC BY-SA 4.0 licence.