In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/5862f74e25eb432805228f80a46c466b20396c27?hp=904cefa8028c48db3b11b95124c356edb7f12b5d>
- Log ----------------------------------------------------------------- commit 5862f74e25eb432805228f80a46c466b20396c27 Author: Karl Williamson <[email protected]> Date: Mon Aug 8 15:48:24 2016 -0600 perlguts: Note how to print Size_t, SSize_t ----------------------------------------------------------------------- Summary of changes: pod/perlguts.pod | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pod/perlguts.pod b/pod/perlguts.pod index cd843a0..03e1610 100644 --- a/pod/perlguts.pod +++ b/pod/perlguts.pod @@ -2674,6 +2674,20 @@ whatever the compiler has. If you are printing addresses of pointers, use UVxf combined with PTR2UV(), do not use %lx or %p. +=head2 Formatted Printing of Size_t and SSize_t + +The most general way to do this is to cast them to a UV or IV, and +print as in the +L<previous section|/Formatted Printing of IVs, UVs, and NVs>. + +But if you're using C<PerlIO_printf()>, it's less typing and visual +clutter to use the C<"%z"> length modifier (for I<siZe>): + + PerlIO_printf("STRLEN is %zu\n", len); + +This modifier is not portable, so its use should be restricted to +C<PerlIO_printf()>. + =head2 Pointer-To-Integer and Integer-To-Pointer Because pointer size does not necessarily equal integer size, -- Perl5 Master Repository
