[previous] 2830 [next] Constant: Division by zero.
Overflow and wraparound

A division (/) or remainder (%) operation has been encountered in which the second operand is a constant expression of value zero. The result will be undefined.

For example:


/*PRQA S 586,2017,2983,2986,3103,3199,3203,3227,3408 ++*/

#define RED  45
#define GRN  45

extern void foo(int n)
{
   int r;

   r = n / (RED - GRN);                     /* 2830 */
}

See also:

QA·C Source Code Analyser 8.1.2
© 2013 Programming Research.
www.programmingresearch.com
Personality Groups | Glossary | Message Index Contents