Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Updated references from C11->C23

...

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.

...

Search for vulnerabilities resulting from the violation of this rule on the CERT website.

Automated Detection

Tool

Version

Checker

Description

Astrée
Include Page
Astrée_V
Astrée_V
restrictSupported indirectly via MISRA C 2012 Rule 8.14.
CodeSonar
Include Page
CodeSonar_V
CodeSonar_V
LANG.TYPE.RESTRICTRestrict qualifier used
Coverity
Include Page
Coverity_V
Coverity_V

MISRA C 2012 Rule 8.14

Partially implemented
Cppcheck Premium

Include Page
Cppcheck Premium_V
Cppcheck Premium_V

premium-cert-exp43-cPartially implemented
GCC8.1-WrestrictFully implemented
Helix QAC

Include Page
Helix QAC_V
Helix QAC_V

C1057
Klocwork

Include Page
Klocwork_V
Klocwork_V

MISRA.TYPE.RESTRICT.QUAL.2012
LDRA tool suite
Include Page
LDRA_V
LDRA_V

480 S, 489 S, 613 S

Enhanced enforcement
Parasoft C/C++test
Include Page
Parasoft_V
Parasoft_V

CERT_C-EXP43-a

The restrict type qualifier shall not be used
PC-lint Plus

Include Page
PC-lint Plus_V
PC-lint Plus_V

586

Assistance provided: reports use of the restrict keyword

Polyspace Bug Finder

Include Page
Polyspace Bug Finder_V
Polyspace Bug Finder_V

CERT C: Rule EXP43-C

Checks for copy of overlapping memory (rule partially covered)

RuleChecker

Include Page
RuleChecker_V
RuleChecker_V

restrictSupported indirectly via MISRA C 2012 Rule 8.14.
SonarQube C/C++ Plugin
Include Page
SonarQube C/C++ Plugin_V
SonarQube C/C++ Plugin_V
S1836Implements 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]


...