Bug #7794
ficl: use ULONG_MAX instead of -1 in lshift operation
Start date:
2017-01-21
Due date:
% Done:
100%
Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:
Description
gcc 6 does complain on (-1 << pwr), so the following fix is needed:
- ficlUnsigned mask = (ficlUnsigned) ~(-1 << pwr);
+ ficlUnsigned mask = ~(ULONG_MAX << pwr);
note we need to use ULONG_MAX as ficl integer type must be same size as the pointer type.
Updated by Electric Monk about 4 years ago
- Status changed from In Progress to Closed
- % Done changed from 90 to 100
git commit 149c4d044787deefb4d4b33243fdfe9fa9094b94
commit 149c4d044787deefb4d4b33243fdfe9fa9094b94 Author: Toomas Soome <tsoome@me.com> Date: 2017-01-22T20:01:04.000Z 7794 ficl: use ULONG_MAX instead of -1 in lshift operation Reviewed by: Igor Kozhukhov <igor@dilos.org> Reviewed by: Alexander Pyhalov <apyhalov@gmail.com> Reviewed by: Andrew Stormont <andyjstormont@gmail.com> Approved by: Robert Mustacchi <rm@joyent.com>