![]() |
![]() |
2831 | ![]() |
||||
![]() | |||||||
| Overflow and wraparound | |||||||
A definite anomaly has been detected. Examination of the context indicates that this expression will always result in division by zero. In the example below, n is zero throughout the code contained in the "if" block and the result of the division operation will always be undefined.
/*PRQA S 587,2017,2983,2986,3103,3199,3203,3227,3408 ++*/
void foo(int x, int n)
{
int r;
if (n == 0)
{
r = x / n; /* 2831 */
}
}
See also:
![]() | ||
| QA·C Source Code Analyser 8.1.2
© 2013 Programming Research. www.programmingresearch.com | Personality Groups | Glossary | Message Index | Contents |