...
Tool | Version | Checker | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
CodeSonar |
| LANG.STRUCT.RPL | Returns pointer to local | ||||||
Compass/ROSE | Can detect violations of this rule. It automatically detects returning pointers to local variables. Detecting more general cases, such as examples where static pointers are set to local variables which then go out of scope, would be difficult | ||||||||
| RETURN_LOCAL | Finds many instances where a function will return a pointer to a local stack variable. Coverity Prevent cannot discover all violations of this rule, so further verification is necessary | |||||||
7.6.0 | Can detect violations when an array is declared in a function and then a pointer to that array is returned | ||||||||
| LOCRET.* | ||||||||
| 42 D, 77 D, 71 S, 565 S | Enhanced Enforcement | |||||||
Parasoft C/C++test | 9.5 | MISRA2004-17_6_{a,b} | |||||||
Polyspace Bug Finder | R2016a | Pointer or reference to stack variable leaving scope | Pointer to local variable leaves the variable scope | ||||||
Declare objects with appropriate storage durationsPRQA QA-C |
| 3217 | Partially implemented | ||||||
Splint |
|
...