[Perl/perl5] 4ab43d: Define print_bytes_for_locale() outside locale

2022-09-02 Thread Karl Williamson via perl5-changes
  Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: 4ab43d2fda7a50fe8b61230a3da8682d73b82a1a
  
https://github.com/Perl/perl5/commit/4ab43d2fda7a50fe8b61230a3da8682d73b82a1a
  Author: Karl Williamson 
  Date:   2022-09-02 (Fri, 02 Sep 2022)

  Changed paths:
M embed.fnc
M embed.h
M locale.c
M proto.h

  Log Message:
  ---
  Define print_bytes_for_locale() outside locale

A future commit will need this even when locales are not used.


  Commit: 091b5ed71023c9935af36a68a005e67aaef5fde8
  
https://github.com/Perl/perl5/commit/091b5ed71023c9935af36a68a005e67aaef5fde8
  Author: Karl Williamson 
  Date:   2022-09-02 (Fri, 02 Sep 2022)

  Changed paths:
M locale.c

  Log Message:
  ---
  locale.c: Refactor #ifdef's for clarity

The my_strerror() function has effectively 5 different implementations
depending on the capabilities of the platform.  Only a few lines are
common to all, the set-up and the return.  The #ifdefs obscure the
underlying logic.  So this commit separates things out so that the
ifdefs don't interrupt the flow as much, with the result that it's
clearer what is going on in each implementation.


  Commit: cb5c690da676cf4043cf4ff7c29cb6db6bdb1634
  
https://github.com/Perl/perl5/commit/cb5c690da676cf4043cf4ff7c29cb6db6bdb1634
  Author: Karl Williamson 
  Date:   2022-09-02 (Fri, 02 Sep 2022)

  Changed paths:
M locale.c

  Log Message:
  ---
  Avoid mojibake in "$!"

In stress testing, I discovered that the LC_CTYPE and LC_MESSAGES
locales need to be the same locale, or strerror() can return
question marks or mojibake instead of the proper message.

This commit refactors the handling of stringifying "$!" to make the
locales of both categories the same during the stringification.

Actually, I suspect it isn't the locale, but the codeset of the locale
that needs to be the same.  I suspect that if the categories were both
in different UTF-8 locales, or both in single-byte locales, that things
would work fine.  But it's cheaper to find the locale rather than the
locale's codeset, so that is what is done.


  Commit: c728a1a6206bcd35a013b6b78f60bdc1adf5bfa2
  
https://github.com/Perl/perl5/commit/c728a1a6206bcd35a013b6b78f60bdc1adf5bfa2
  Author: Karl Williamson 
  Date:   2022-09-02 (Fri, 02 Sep 2022)

  Changed paths:
M embed.fnc
M embed.h
M locale.c
M makedef.pl
M mg.c
M proto.h

  Log Message:
  ---
  Move utf8ness calc for $! into locale.c from mg.c

locale.c has the infrastructure to handle this, so remove repeated
logic.

The removed code tried to discern better based on using script runs, but
this actually doesn't help, so is removed.

Since we're now using C99, we can remove the block that was previously
needed, and now the code is properly indented, whereas before it wasn't


  Commit: 8fffab5814a1dec668cc4056a4a6e0a06b0309f1
  
https://github.com/Perl/perl5/commit/8fffab5814a1dec668cc4056a4a6e0a06b0309f1
  Author: Karl Williamson 
  Date:   2022-09-02 (Fri, 02 Sep 2022)

  Changed paths:
M embed.fnc
M locale.c
M proto.h

  Log Message:
  ---
  locale.c: Add const to my_strerror retrurn

A bit of safety


  Commit: 3d118badf8a1b8d6cfcb6bf98a51ff62b0b0379a
  
https://github.com/Perl/perl5/commit/3d118badf8a1b8d6cfcb6bf98a51ff62b0b0379a
  Author: Karl Williamson 
  Date:   2022-09-02 (Fri, 02 Sep 2022)

  Changed paths:
M embed.fnc
M embed.h
M embedvar.h
M intrpvar.h
M locale.c
M proto.h
M sv.c

  Log Message:
  ---
  locale.c: Rmv no longer used code; UTF8ness cache

What these functions do has been subsumed by code introduced in previous
commits, and in a more straight forward manner.

Also removed in this commit is the cache of the knowing what locales are
UTF-8 or not.  This data is now cheaper to calculate when needed, and
there is now a single entry cache, so I don't think the complexity
warrants keeping it.

It could be added back if necessary, split off from the remainder of
this commit.


  Commit: 8544fe162d08b4ee03c9249ae2e4bdee667b0056
  
https://github.com/Perl/perl5/commit/8544fe162d08b4ee03c9249ae2e4bdee667b0056
  Author: Karl Williamson 
  Date:   2022-09-02 (Fri, 02 Sep 2022)

  Changed paths:
M embed.fnc
M embed.h
M locale.c
M proto.h

  Log Message:
  ---
  locale.c: Convert final use of S_category_name()

The previous commit removed all but one use of this function, which is
replaceable by an array lookup


  Commit: 69bc7167fa24b1e8d3f810ce465d84bdddf413f6
  
https://github.com/Perl/perl5/commit/69bc7167fa24b1e8d3f810ce465d84bdddf413f6
  Author: Karl Williamson 
  Date:   2022-09-02 (Fri, 02 Sep 2022)

  Changed paths:
M embed.fnc
M embed.h
M embedvar.h
M intrpvar.h
M locale.c
M makedef.pl
M mg.c
M proto.h
M sv.c

  Log Message:
  ---
  Merge branch 'Locale changes for "$!"' into blead

This series of commits 

[Perl/perl5] 501e24: .github/CONTRIBUTING.pd - Fixup symlink to be rela...

2022-09-02 Thread Yves Orton via perl5-changes
  Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: 501e249dd39385221924c1301c5a6d3439c4acc4
  
https://github.com/Perl/perl5/commit/501e249dd39385221924c1301c5a6d3439c4acc4
  Author: Yves Orton 
  Date:   2022-09-02 (Fri, 02 Sep 2022)

  Changed paths:
M .github/CONTRIBUTING.pod

  Log Message:
  ---
  .github/CONTRIBUTING.pd - Fixup symlink to be relative




[Perl/perl5] cda9a1: Create .github/CONTRIBUTING.pod

2022-09-02 Thread Elvin Aslanov via perl5-changes
  Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: cda9a136906e25151879b4c41c30ad1323e6d7da
  
https://github.com/Perl/perl5/commit/cda9a136906e25151879b4c41c30ad1323e6d7da
  Author: Elvin Aslanov 
  Date:   2022-09-02 (Fri, 02 Sep 2022)

  Changed paths:
A .github/CONTRIBUTING.pod

  Log Message:
  ---
  Create .github/CONTRIBUTING.pod

Adding a standard GitHub file as a symlink to pod/perlhack.pod

See https://github.com/Perl/perl5/community




[Perl/perl5]

2022-09-02 Thread Yves Orton via perl5-changes
  Branch: refs/heads/yves/delta_for_errorquoting
  Home:   https://github.com/Perl/perl5


[Perl/perl5] 235ba4: Add a perldelta for SVf_QUOTEDPREFIX changes to er...

2022-09-02 Thread Yves Orton via perl5-changes
  Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: 235ba407259e77edb72d215c0c3dc0ea99570933
  
https://github.com/Perl/perl5/commit/235ba407259e77edb72d215c0c3dc0ea99570933
  Author: Yves Orton 
  Date:   2022-09-02 (Fri, 02 Sep 2022)

  Changed paths:
M pod/perldelta.pod

  Log Message:
  ---
  Add a perldelta for SVf_QUOTEDPREFIX changes to error messages




[Perl/perl5] 9d5942: *.h - Standardize format, whitespace cleanup only

2022-09-02 Thread Yves Orton via perl5-changes
  Branch: refs/heads/yves/ws_cleanup_headers
  Home:   https://github.com/Perl/perl5
  Commit: 9d594290ea8448e8433f4416bc2f1e1ffe2afe99
  
https://github.com/Perl/perl5/commit/9d594290ea8448e8433f4416bc2f1e1ffe2afe99
  Author: Yves Orton 
  Date:   2022-09-02 (Fri, 02 Sep 2022)

  Changed paths:
M EXTERN.h
M INTERN.h
M XSUB.h
M av.h
M cop.h
M cv.h
M dosish.h
M fakesdio.h
M form.h
M gv.h
M handy.h
M hv.h
M hv_func.h
M hv_macro.h
M inline.h
M intrpvar.h
M invlist_inline.h
M iperlsys.h
M malloc_ctl.h
M mg.h
M mydtrace.h
M nostdio.h
M op.h
M op_reg_common.h
M pad.h
M parser.h
M perl.h
M perl_inc_macro.h
M perl_langinfo.h
M perl_siphash.h
M perlio.h
M perliol.h
M perlvars.h
M pp.h
M regcomp.h
M regexp.h
M sbox32_hash.h
M scope.h
M sv.h
M sv_inline.h
M thread.h
M time64.h
M time64_config.h
M uconfig.h
M unixish.h
M utf8.h
M utfebcdic.h
M util.h
M vutil.h
M zaphod32_hash.h

  Log Message:
  ---
  *.h - Standardize format, whitespace cleanup only

View this patch with -w and it should show no changes at all.

This reformats our manually maintained header files.

All defines are lined up.

All structs are given a standardized format.

All multiline macros are given consistent escaped newlines positions.

Where things are lined up we use P95 of the length, so very long things
do not cause massive indents, so a few long entries may not line up.


  Commit: b1d52ac427d45cf2c14450d801bf65d646268c56
  
https://github.com/Perl/perl5/commit/b1d52ac427d45cf2c14450d801bf65d646268c56
  Author: Yves Orton 
  Date:   2022-09-02 (Fri, 02 Sep 2022)

  Changed paths:
M cop.h
M hv_func.h
M op.h
M perl.h
M pp.h
M sbox32_hash.h
M scope.h
M sv.h
M unixish.h
M zaphod32_hash.h

  Log Message:
  ---
  put STMT_START on its own line


Compare: https://github.com/Perl/perl5/compare/a96ddab70295...b1d52ac427d4


[Perl/perl5] 7bd2df: Add a perldelta for SVf_QUOTEDPREFIX changes to er...

2022-09-02 Thread Yves Orton via perl5-changes
  Branch: refs/heads/yves/delta_for_errorquoting
  Home:   https://github.com/Perl/perl5
  Commit: 7bd2df5dfb8a865d06afadcf1783ec197fa2eaac
  
https://github.com/Perl/perl5/commit/7bd2df5dfb8a865d06afadcf1783ec197fa2eaac
  Author: Yves Orton 
  Date:   2022-09-02 (Fri, 02 Sep 2022)

  Changed paths:
M pod/perldelta.pod

  Log Message:
  ---
  Add a perldelta for SVf_QUOTEDPREFIX changes to error messages




[Perl/perl5] 55ac59: perl.h - remove duplicated code from commented exp...

2022-09-02 Thread Yves Orton via perl5-changes
  Branch: refs/heads/yves/ws_cleanup_headers
  Home:   https://github.com/Perl/perl5
  Commit: 55ac59e4d0c12b2852be298f761c6c0592c978be
  
https://github.com/Perl/perl5/commit/55ac59e4d0c12b2852be298f761c6c0592c978be
  Author: Yves Orton 
  Date:   2022-09-02 (Fri, 02 Sep 2022)

  Changed paths:
M perl.h

  Log Message:
  ---
  perl.h - remove duplicated code from commented explanation


  Commit: ab9f0f5dfc643b8ab9b8e741d738b3b291ed9feb
  
https://github.com/Perl/perl5/commit/ab9f0f5dfc643b8ab9b8e741d738b3b291ed9feb
  Author: Yves Orton 
  Date:   2022-09-02 (Fri, 02 Sep 2022)

  Changed paths:
M intrpvar.h

  Log Message:
  ---
  intrpvar.h - change "char * *" into "char **"

Uniformity in such things is good.


  Commit: 51564464aba17d0e622dbe67913570397b11f866
  
https://github.com/Perl/perl5/commit/51564464aba17d0e622dbe67913570397b11f866
  Author: Yves Orton 
  Date:   2022-09-02 (Fri, 02 Sep 2022)

  Changed paths:
M intrpvar.h

  Log Message:
  ---
  intrpvar.h - move size declaration to a define

so it can be reused and so the PERLVAR() lines up better.


  Commit: 2fb42ee864a6aec436de7ebb8db4d967ac1a9e9f
  
https://github.com/Perl/perl5/commit/2fb42ee864a6aec436de7ebb8db4d967ac1a9e9f
  Author: Yves Orton 
  Date:   2022-09-02 (Fri, 02 Sep 2022)

  Changed paths:
M perlvars.h

  Log Message:
  ---
  perlvars.h - move length computation to a define

So it can be reused if necessary, also because it makes
parsing PERLVARx() statements easier, this is the only
place where such a definition has a parameter that contains
a parenthesis. Moving it to a define makes it easier to
parse these statements externally in some ways.


  Commit: a75988d947f1b5d4669590c04cfad52708370708
  
https://github.com/Perl/perl5/commit/a75988d947f1b5d4669590c04cfad52708370708
  Author: Yves Orton 
  Date:   2022-09-02 (Fri, 02 Sep 2022)

  Changed paths:
M regexp.h

  Log Message:
  ---
  regexp.h - move semicolon to be before the comment.

This is the only struct in our manually maintained files where
there is a comment in front of the semicolon instead of after it.


  Commit: 07875dbfff4bed279016f7ef25daa5524b3ff867
  
https://github.com/Perl/perl5/commit/07875dbfff4bed279016f7ef25daa5524b3ff867
  Author: Yves Orton 
  Date:   2022-09-02 (Fri, 02 Sep 2022)

  Changed paths:
M XSUB.h

  Log Message:
  ---
  XSUB.h - put STMT_END on its own line and lined up with STMT_START


  Commit: fa3adb96454ffe53e7ec1f53f734367623708bb0
  
https://github.com/Perl/perl5/commit/fa3adb96454ffe53e7ec1f53f734367623708bb0
  Author: Yves Orton 
  Date:   2022-09-02 (Fri, 02 Sep 2022)

  Changed paths:
M perl.h

  Log Message:
  ---
  perl.h - put STMT_END on its own line, and lined up with STMT_START


  Commit: f281d310bcfe500734c44e7ca386a5a9559f2811
  
https://github.com/Perl/perl5/commit/f281d310bcfe500734c44e7ca386a5a9559f2811
  Author: Yves Orton 
  Date:   2022-09-02 (Fri, 02 Sep 2022)

  Changed paths:
M regexp.h

  Log Message:
  ---
  regexp.h - put STMT_END on its own line and lined up with STMT_START


  Commit: f1b920d0c06a1924e3582e857c4ad036da32
  
https://github.com/Perl/perl5/commit/f1b920d0c06a1924e3582e857c4ad036da32
  Author: Yves Orton 
  Date:   2022-09-02 (Fri, 02 Sep 2022)

  Changed paths:
M regcomp.h

  Log Message:
  ---
  regcomp.h - put STMT_START on its own line and lined up with STMT_END


  Commit: a96ddab7029557e32194a424133aef25257492c2
  
https://github.com/Perl/perl5/commit/a96ddab7029557e32194a424133aef25257492c2
  Author: Yves Orton 
  Date:   2022-09-02 (Fri, 02 Sep 2022)

  Changed paths:
M pp.h

  Log Message:
  ---
  pp.h - put STMT_END on its own line and lined up STMT_START


Compare: https://github.com/Perl/perl5/compare/89f9b9db73cd...a96ddab70295


[Perl/perl5]

2022-09-02 Thread Yves Orton via perl5-changes
  Branch: refs/heads/yves/eval_begin_nest_depth
  Home:   https://github.com/Perl/perl5


[Perl/perl5] 741a5c: op.c - Restrict nested eval/BEGIN blocks to a user...

2022-09-02 Thread Yves Orton via perl5-changes
  Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: 741a5c7396a0ca90a22ea8d8e0761c70c14b0a77
  
https://github.com/Perl/perl5/commit/741a5c7396a0ca90a22ea8d8e0761c70c14b0a77
  Author: Yves Orton 
  Date:   2022-09-02 (Fri, 02 Sep 2022)

  Changed paths:
M INSTALL
M embedvar.h
M intrpvar.h
M op.c
M perl.h
M pod/perldelta.pod
M pod/perldiag.pod
M pod/perlfunc.pod
M pod/perlvar.pod
M sv.c
M t/op/eval.t

  Log Message:
  ---
  op.c - Restrict nested eval/BEGIN blocks to a user controllable maximum

Nested BEGIN blocks can cause us to segfault by exhausting
the C stack. Eg:

perl -le'sub f { eval "BEGIN { f() }" } f()'

will segfault. This adds a new interpreter var PL_eval_begin_nest_depth
to keep track of how many layer of eval/BEGIN we have seen, and a new
reserved variable called ${^MAX_NESTED_EVAL_BEGIN_BLOCKS} which can be
used to raise or lower the limit. When set to 0 it blocks BEGIN entirely,
which might be useful from time to time.

This fixes https://github.com/Perl/perl5/issues/20176