develooper Front page | perl.perl5.porters | Postings from January 2009

N! and other pack formats added in change 22663 (068bd2e7e6b490383a9259507cd9652925bab47a) improperly documented

Thread Next
From:
=?UTF-8?Q?=C3=86var_Arnfj=C3=B6r=C3=B0_Bjarmason?=
Date:
January 6, 2009 21:53
Subject:
N! and other pack formats added in change 22663 (068bd2e7e6b490383a9259507cd9652925bab47a) improperly documented
Message ID:
51dd1af80901062153rce72d56ja296d4bfdcd4cae3@mail.gmail.com
Change 22663 added support for n, N, v and V to accept the ! modifier:

http://www.mail-archive.com/perl5-changes@perl.org/msg09541.html

However, perlfunc states:

One or more of the modifiers below may optionally follow some letters
in the TEMPLATE (the second column lists the letters for which the
modifier is valid):

    !   sSlLiI     Forces native (short, long, int) sizes instead
                   of fixed (16-/32-bit) sizes.

Which means code that uses that feature is incompatable with pre-5.10:

sh-3.2$ perl5.8.8 -le 'print pack "N!", 0'
'!' allowed only after types sSiIlLxX in pack at -e line 1.
sh-3.2$ perl5.10.0 -le 'print pack "N!", 0'

But AFAICT this isn't mentioned in perl5100delta. I would submit a
documentation patch but I don't fully understand what the
SHRIEKING_ALLOWED_TYPES macro in pp_pack.c is doing, at a glance
anyway.

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