develooper Front page | perl.perl5.porters | Postings from May 2019

[perl #134044] Current perl undefined C behaviors

Karl Williamson via RT
May 25, 2019 14:00
[perl #134044] Current perl undefined C behaviors
Message ID:
These were applied as
commit 814735a391b874af8f00eaf89469e5ec7f38cd4a
 Author: Karl Williamson <>
 Date:   Fri May 3 13:57:47 2019 -0600
     Remove undefined behavior from IV shifting
     It is undefined behavior to shift a negative integer to the left.  This
     commit avoids that by treating the value as unsigned, then casting back
     to integer for return.

commit 3a019afd6f6291c3249c254b5c01e244e4ec83ab
 Author: Karl Williamson <>
 Date:   Sun Apr 28 17:42:44 2019 -0600
     Create fcn for lossless conversion of NV to IV
     Essentially the same code was being used in three places, and had
     undefined C behavior for some inputs.
     This consolidates the code into one inline function, and rewrites it to
     avoid undefined behavior.
Karl Williamson

via perlbug:  queue: perl5 status: open Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About