...
| Wiki Markup |
|---|
This example does not comply with \[[INT01-A. Use size_t for all integer values representing the size of an object]\]. |
Implementation Details
Microsoft Visual Studio
...
To provide a true (never negative) modulo operation, use the IMOD imod() ("integer modulo") macroinline function:
| Code Block | ||
|---|---|---|
| ||
/* modulo macrofunction giving non-negative result */ #defineinline int IMODimod(int i, int j) (((i){ return (i % (j)) < 0 ? ((i) % (j)) + (j) : ((i) % (j))) /* if i % j is never negative, replace with the following line: */ /* #define IMOD(i, j) ((i) % (j)) */; } |
Risk Assessment
Rule | Severity | Likelihood | Remediation Cost | Priority | Level |
|---|---|---|---|---|---|
STR07-A | 1 (low) | 1 (unlikely) | 2 (medium) | P2 | L3 |
...