In perl.git, the branch smoke-me/arc/printf-fixes has been created

<http://perl5.git.perl.org/perl.git/commitdiff/b2d5696f08aa47eefb2609098081577600f43730?hp=0000000000000000000000000000000000000000>

        at  b2d5696f08aa47eefb2609098081577600f43730 (commit)

- Log -----------------------------------------------------------------
commit b2d5696f08aa47eefb2609098081577600f43730
Author: Aaron Crane <[email protected]>
Date:   Wed Jul 8 12:55:18 2015 +0100

    perldelta for recent printf changes

M       pod/perldelta.pod

commit e0f6f9e75c0632ee5199598590e086d2e063792f
Author: Aaron Crane <[email protected]>
Date:   Tue Jul 7 18:16:36 2015 +0100

    Document and ensure that sv_catpvf() does no argument ordering
    
    sv_catpvf() and friends ultimately end up calling sv_vcatpvfn_flags() with a
    C-style va_list argument (rather than with an array of SV pointers). When
    the sprintf implementation in sv_vcatpvfn_flags() is called with a va_list
    it always ignores any attempt by the format string to reorder the arguments.
    This reasonable limitation is now documented, and the implementation throws
    an exception when it encounters this situation.
    
    Minimal tests for these exceptions have been added to XS::APItest.

M       MANIFEST
M       ext/XS-APItest/APItest.pm
M       ext/XS-APItest/APItest.xs
A       ext/XS-APItest/t/svcatpvf.t
M       pod/perldiag.pod
M       sv.c

commit 5361dc6c50d2288f4403157bf687c600ca301a65
Author: Aaron Crane <[email protected]>
Date:   Tue Jul 7 17:12:26 2015 +0100

    Support reordered precision arguments in (s)printf
    
    The printf builtins gained support for argument reordering in October 2000,
    in eb3fce905f8436bbc374998ec8c7c34ce2b73e4e, as part of the 5.7.x blead
    release cycle. However, a simple typo meant that it never worked: the
    initial implementation stored the argument index in the variable "ewix"
    (explicit width-argument index) instead of "epix" (for "precision").
    
    The bug was noticed in July 2002, two days before the 5.8.0 release, so
    fixing it at that stage was deemed riskier than documenting it. The commit 
in
    question is 7b8dd722af72d0ca45650fb784c09763c0732e34, which was originally
    posted as http://marc.info/?l=perl5-porters&m=102683138220786&w=2 .
    
    For whatever reason, the obvious fix was never subsequently applied. This
    commit remedies that, and extends it to also skip all redundant-argument
    warnings when the precision is supplied with via an explicit index.

M       pod/perlfunc.pod
M       sv.c
M       t/op/sprintf.t

commit c2ecd786903470394bd5859c8c211f077d533d56
Author: Aaron Crane <[email protected]>
Date:   Mon Jun 29 16:35:11 2015 +0100

    sv_vcatpvfn_flags(): make warnings more precise
    
    - RT#125469 points out that no "redundant argument" warning should be 
emitted
      for code like C<< printf '<%*2$s>', "a", 6 >>; that's now fixed.
    
    - We no longer emit a "missing argument" warning for invalid format strings,
      so C<< printf '%4$K %d', 17 >> now emits one "invalid" warning, and no
      other warnings. (Perl 5.12 and subsequent versions have inappropriately
      emitted a "missing argument" warning in this case.)
    
    - We no longer treat the invalid format string in C<< printf '%1$$d', 17 >>
      as containing an explicit index, so (a) we emit an "invalid" warning for
      the double "$", and (b) we emit a "redundant argument" warning for the
      trailing argument. The "redundant argument" warning is new in this
      situation.

M       sv.c
M       t/op/sprintf.t

commit 8d273c23c10865155068cb5585079ed17d84babb
Author: Aaron Crane <[email protected]>
Date:   Mon Jun 29 16:34:45 2015 +0100

    t/op/sprintf.t: include test comment in "ok" output, where available

M       t/op/sprintf.t
-----------------------------------------------------------------------

--
Perl5 Master Repository

Reply via email to