cppcheck: (error) Shifting signed 64-bit value by 63 bits

As of cppcheck 1.82 surpress the warning regarding shifting too many
bits for __divdi3() implemention.  The algorithm used here is correct.

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #9732
This commit is contained in:
Ubuntu 2019-12-14 00:16:42 +00:00 committed by Tony Hutter
parent 363d7332f2
commit 603ae6a8c0

View File

@ -273,7 +273,9 @@ int64_t
__divdi3(int64_t u, int64_t v)
{
int64_t q, t;
// cppcheck-suppress shiftTooManyBitsSigned
q = __udivdi3(abs64(u), abs64(v));
// cppcheck-suppress shiftTooManyBitsSigned
t = (u ^ v) >> 63; // If u, v have different
return ((q ^ t) - t); // signs, negate q.
}