...
The C Standard [ISO/IEC 9899:20112024] identifies the following undefined behavior:
A restrict-qualified pointer is assigned a value based on another restricted pointer whose associated block neither began execution before the block associated with this pointer, nor ended before the assignment (6.7.34.12).
This is an oversimplification, however, and it is important to review the formal definition of restrict in subclause 6.7.3.1 of the C Standard to properly understand undefined behaviors associated with the use of restrict
-qualified pointers.
...
Tool | Version | Checker | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
Astrée |
| restrict | Supported indirectly via MISRA C 2012 Rule 8.14. | ||||||
CodeSonar |
| LANG.TYPE.RESTRICT | Restrict qualifier used | ||||||
Coverity |
| MISRA C 2012 Rule 8.14 | Partially implemented | ||||||
Cppcheck Premium |
| premium-cert-exp43-c | Partially implemented | ||||||
GCC | 8.1 | -Wrestrict | Fully implemented | ||||||
Helix QAC |
| C1057 | |||||||
Klocwork |
| MISRA.TYPE.RESTRICT.QUAL.2012 | |||||||
LDRA tool suite |
| 480 S, 489 S, 613 S | Enhanced enforcement | ||||||
Parasoft C/C++test |
| CERT_C-EXP43-a | The restrict type qualifier shall not be used | ||||||
PC-lint Plus |
| 586 | Assistance provided: reports use of the restrict keyword | ||||||
Polyspace Bug Finder |
| Checks for copy of overlapping memory (rule partially covered) | |||||||
RuleChecker |
| restrict | Supported indirectly via MISRA C 2012 Rule 8.14. | ||||||
SonarQube C/C++ Plugin |
| S1836 | Implements MISRA C:2012 Rule 8.14 to flag uses of restrict |
Related Guidelines
Key here (explains table format and definitions)
...
Bibliography
[ISO/IEC 9899:20112024] | 6.7.34.12, "Formal Definition of of restrict " |
[Walls 2006] |
...