Project

General

Profile

Actions

Bug #7794

closed

ficl: use ULONG_MAX instead of -1 in lshift operation

Added by Toomas Soome over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
cmd - userland programs
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.

Actions #1

Updated by Electric Monk over 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>

Actions

Also available in: Atom PDF