...
This compliant solution follows the guidance of PRE00-C. Prefer inline or static functions to function-like macros by defining an inline function iabs() to replace the ABS() macro. Unlike the ABS() macro, which operates on operands of any type, the iabs() function will truncate arguments of types wider than int whose value is not in range of the latter type.
...
Tool | Version | Checker | Description | ||||||
|---|---|---|---|---|---|---|---|---|---|
| Axivion Bauhaus Suite |
| CertC-PRE31 | Fully implemented | ||||||
| ASSERT_SIDE_EFFECTS | Partially implemented Can detect the specific instance where assertion contains an operation/function call that may have a side effect | |||||||
| ECLAIR |
| CC2.EXP31 CC2.PRE31 | Fully implemented | ||||||
| LDRA tool suite |
| 9 S, 562 S, 572 S, 35 D, 1 Q | Fully implemented | ||||||
| Parasoft C/C++test |
| CERT_C-PRE31-a | A full expression containing an increment (++) or decrement (--) operator should have no other potential side effects | ||||||
| Polyspace Bug Finder |
| CERT C: Rule PRE31-C | Checks for side effect in arguments to unsafe macro (rule partially covered) | ||||||
| PRQA QA-C |
| 3462, 3463, 3464, 3465, 3466, 3467 | Fully implemented | ||||||
| PRQA QA-C++ |
| 3225, 3226, 3227, 3228, 3229 |
...