-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix outputting extreme integer values in edge cases
For some gcc version (Ubuntu 5.5.0-12ubuntu1~16.04) the existing code crashes when the minimum value of int64_t is outputted. Resurrect the code from before 546e2cb (:rotating_light: fixed some warnings, 2019-03-13) but delegate the sign removal so that the compilers don't complain about taking the negative value of an unsigned value. In addition we also rewrite the expression so that we first increment and then negate. We on purpose don't supply a definition of remove_sign(number_unsigned_t) as we only need the compiler to see the declaration but never call the function.
- Loading branch information
Showing
2 changed files
with
18 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters