develooper Front page | perl.perl5.porters | Postings from April 2013

[perl #117729] "splice() offset past end of array" warning doesn't always appear

Thread Previous | Thread Next
From:
James E Keenan via RT
Date:
April 24, 2013 00:35
Subject:
[perl #117729] "splice() offset past end of array" warning doesn't always appear
Message ID:
rt-3.6.HEAD-28177-1366763683-462.117729-15-0@perl.org
On Tue Apr 23 13:14:02 2013, perl@froods.org wrote:
> 
> According to the splice documentation in perlfunc:
> 
>    splice ARRAY or EXPR,OFFSET
> 
>    If OFFSET is past the end of the array, Perl issues a warning, and
>    splices at the end of the array.
> 
> Consider:
>     perl -wle'use warnings FATAL => "all"; my @arr = qw(0 .. 10);
> splice(@arr, 20); print "ar is @arr"'
> 
> This generates a warning on some versions/architectures and not
> others.
> Based on the versions tested, this appears to have regressed between
> 5.14.3
> and 5.16.0.
> 
> 
> warning:
> 5.8.9 darwin OSX 10.6.8
> 5.14.2 darwin OSX 10.6.8
> 5.14.3 darwin OSX 10.6.8
> 5.14.3 linux CentOS
> 
> no warning:
> 5.16.0 linux ubuntu
> 5.16.0 darwin OSX 10.6.8
> 5.16.1 darwin OSX 10.6.8
> 5.16.3 darwin OSX 10.6.8
> 5.17.11 darwin OSX 10.6.8
> 


Confirmed to occur in blead as well.

---
via perlbug:  queue: perl5 status: new
https://rt.perl.org:443/rt3/Ticket/Display.html?id=117729

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About