[Perl/perl5] eff57c: hv_undef_flags: eliminate spurious -Warray-bounds ...

2024-04-14 Thread Tony Cook via perl5-changes
  Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: eff57c4d73898d2174f80490cb2efe2821f5ea46
  
https://github.com/Perl/perl5/commit/eff57c4d73898d2174f80490cb2efe2821f5ea46
  Author: Tony Cook 
  Date:   2024-04-15 (Mon, 15 Apr 2024)

  Changed paths:
M hv.c

  Log Message:
  ---
  hv_undef_flags: eliminate spurious -Warray-bounds warning

Eliminates:

In file included from perl.h:6205,
 from hv.c:35:
hv.c: In function ‘Perl_hv_undef_flags’:
hv.h:460:26: warning: array subscript [0, 9223372036854775807] is outside array 
bounds of ‘char[0]’ [-Warray-bounds]
  460 | #define HEK_FLAGS(hek)  (*((unsigned char 
*)(HEK_KEY(hek))+HEK_LEN(hek)+1))
  | 
~^~
embed.h:292:78: note: in definition of macro ‘hv_common’
  292 | mmon(a,b,c,d,e,f,g,h) Perl_hv_common(aTHX_ a,b,c,d,e,f,g,h)
  |^

hv.h:474:34: note: in expansion of macro ‘HEK_FLAGS’
  474 | #define HEK_UTF8(hek)   (HEK_FLAGS(hek) & HVhek_UTF8)
  |  ^
hv.h:579:55: note: in expansion of macro ‘HEK_UTF8’
  579 | hv_common((hv), NULL, HEK_KEY(hek), HEK_LEN(hek), HEK_UTF8(hek), \
  |   ^~~~
hv.c:2268:19: note: in expansion of macro ‘hv_deletehek’
 2268 | (void)hv_deletehek(PL_stashcache, HvNAME_HEK(hv), 
G_DISCARD);
  |   ^~~~

This does appear to be spurious, the gcc documentation claims not
to check array bounds on trailing 1 element arrays for backward
compatibility.

This warning would be reasonable if the hek itself was allocated on
the stack, part of an array of HEKs, or embedded in another struct,
but HvNAME_HEK() returns a pointer to a HEK, for which gcc has no
knowledge of the source.

This warning only appears in debugging builds, but the only
difference from non-debugging builds is the HEKfARG() within the
DEBUG_o(), which is a simple cast to (void *), which I don't see
having an effect on whether the compiler considers HEK itself as
part of a structure, or of unknown origin.

So I expect it's just a gcc bug, and there are know issues with this
warning.


  Commit: 1edc2b4ee3077fc72d6364edfe0281ea10aab252
  
https://github.com/Perl/perl5/commit/1edc2b4ee3077fc72d6364edfe0281ea10aab252
  Author: Tony Cook 
  Date:   2024-04-15 (Mon, 15 Apr 2024)

  Changed paths:
M locale.c

  Log Message:
  ---
  toggle_locale_i: eliminate NULL for %s format warning

The C99 printf() family of functions do not permit a NULL
pointer for the %s format specifier.

In this case, there's a NULL check done immediately afterwards,
allowing the compiler to detect that locale_to_restore_to could
be NULL.

While PerlIO_printf() (via sv_vcatpvfn_flags()) does allow NULL,
it isn't permitted by the standard implementation, so gcc warns.

Ideally the compiler would provide customisation hooks for this
warning, but it doesn't, and since the -Wformat family of
warnings are useful, do the minimal change to prevent it in
this case.


Compare: https://github.com/Perl/perl5/compare/a7b106d5563e...1edc2b4ee307

To unsubscribe from these emails, change your notification settings at 
https://github.com/Perl/perl5/settings/notifications


[Perl/perl5] a7b106: perlhacktips: point at some more tools

2024-04-14 Thread Tony Cook via perl5-changes
  Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: a7b106d5563e1b4fb906b378d558d9c68abba69e
  
https://github.com/Perl/perl5/commit/a7b106d5563e1b4fb906b378d558d9c68abba69e
  Author: Tony Cook 
  Date:   2024-04-15 (Mon, 15 Apr 2024)

  Changed paths:
M pod/perlhacktips.pod

  Log Message:
  ---
  perlhacktips: point at some more tools



To unsubscribe from these emails, change your notification settings at 
https://github.com/Perl/perl5/settings/notifications


[Perl/perl5] a742fa: allow building with high-water mark to be independ...

2024-04-14 Thread Tony Cook via perl5-changes
  Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: a742fa0e6169e9ee5576a516293d015390c2444d
  
https://github.com/Perl/perl5/commit/a742fa0e6169e9ee5576a516293d015390c2444d
  Author: Tony Cook 
  Date:   2024-04-15 (Mon, 15 Apr 2024)

  Changed paths:
M cop.h
M dump.c
M ext/XS-APItest/APItest.pm
M ext/XS-APItest/APItest.xs
M ext/XS-APItest/t/extend.t
M op.c
M perl.c
M perl.h
M pp.h
M pp_hot.c
M scope.c
M sv.c

  Log Message:
  ---
  allow building with high-water mark to be independent of -DDEBUGGING

This allows a debugging perl to be built with the high water mark
checks disabled, or a non-debugging perl to be built with the
high water marks enabled.

This should allow Debian, the reporter for #16607 to build both their
normal perl and debugperl with the same state of high water mark
checks and avoid the mismatch between a debugperl and non-debug
dynamic extension.

Fixes #16607



To unsubscribe from these emails, change your notification settings at 
https://github.com/Perl/perl5/settings/notifications


[Perl/perl5] 224c53: win32.c: suppress -Wcast-function-type warnings

2024-04-14 Thread Tony Cook via perl5-changes
  Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: 224c53df969893d76a3d94c4ce4e3684925f36a8
  
https://github.com/Perl/perl5/commit/224c53df969893d76a3d94c4ce4e3684925f36a8
  Author: Tony Cook 
  Date:   2024-04-15 (Mon, 15 Apr 2024)

  Changed paths:
M win32/win32.c

  Log Message:
  ---
  win32.c: suppress -Wcast-function-type warnings

This appears to be the only place these warnings are produced even
though win32/win32.c contains several other function type casts.

None of the non-warning casts use the "void (*)(void)" type that is
documented to suppress the warning, and adding such a cast to
the lines warning seems less safe to me, cast from a stdcall
function pointer to a cdecl function pointer and back.

So, just suppress the warning where I saw it.


  Commit: a33729fe9919fce96c2a5fd196825c4208b2cbe2
  
https://github.com/Perl/perl5/commit/a33729fe9919fce96c2a5fd196825c4208b2cbe2
  Author: Tony Cook 
  Date:   2024-04-15 (Mon, 15 Apr 2024)

  Changed paths:
M win32/win32.c

  Log Message:
  ---
  win32.c: don't call wcscpy() with in == out

Since both the input and output parameters are restrict qualified,
this would be invalid, and it is possibe for PerlDir_mapW() to return
its parameter.  This warned on gcc:

win32.c: In function 'win32_link':
win32.c:3712:40: warning: passing argument 1 to 'restrict'-qualified parameter 
aliases with argument 2 [-Wrestrict]
 3712 | ((aTHXa(PERL_GET_THX)), wcscpy(wOldName, 
PerlDir_mapW(wOldName)),
  |^~~~


Compare: https://github.com/Perl/perl5/compare/0e766d6b46e9...a33729fe9919

To unsubscribe from these emails, change your notification settings at 
https://github.com/Perl/perl5/settings/notifications


[Perl/perl5] 0e766d: perlrun: document the exit status for the -c option

2024-04-14 Thread Tony Cook via perl5-changes
  Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: 0e766d6b46e909a7f6bdb02c724ce0b051a47056
  
https://github.com/Perl/perl5/commit/0e766d6b46e909a7f6bdb02c724ce0b051a47056
  Author: Tony Cook 
  Date:   2024-04-15 (Mon, 15 Apr 2024)

  Changed paths:
M pod/perlrun.pod

  Log Message:
  ---
  perlrun: document the exit status for the -c option

Fixes #21686



To unsubscribe from these emails, change your notification settings at 
https://github.com/Perl/perl5/settings/notifications


[Perl/perl5] ba0d31: inline.h (S_lossless_NV_to_IV): don't convert inac...

2024-04-14 Thread TAKAI Kousuke via perl5-changes
  Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: ba0d3138eab422f41d682bceda32d9a5da1e0794
  
https://github.com/Perl/perl5/commit/ba0d3138eab422f41d682bceda32d9a5da1e0794
  Author: TAKAI Kousuke <62541129+t-...@users.noreply.github.com>
  Date:   2024-04-14 (Sun, 14 Apr 2024)

  Changed paths:
M inline.h
M t/op/numconvert.t

  Log Message:
  ---
  inline.h (S_lossless_NV_to_IV): don't convert inaccurate integral value to IV

S_lossless_NV_to_IV() should be consistent with SvIV_please_nomg()
which will not implicitly convert the NV that is not accurate up to
the decimal point, i.e., >= (1 << NV_PRESERVES_UV_BITS) in magnitude,
to the IV even if it has no fractional part (looks like integer).

Mismatch of these conversions used to cause inconsistency like this:

   % perl -le 'print 0x1p60 + 0'
   1.15292150460685e+18
   % perl -le 'print 0x1p60 + 0.0'
   1152921504606846976

t/op/numconvert.t: Added tests for this.



To unsubscribe from these emails, change your notification settings at 
https://github.com/Perl/perl5/settings/notifications


[Perl/perl5]

2024-04-14 Thread James E Keenan via perl5-changes
  Branch: refs/heads/jkeenan/semantic-versioning
  Home:   https://github.com/Perl/perl5

To unsubscribe from these emails, change your notification settings at 
https://github.com/Perl/perl5/settings/notifications


[Perl/perl5] 4f872e: perlexperiment.pod: Only certain functions in buil...

2024-04-14 Thread Paul Evans via perl5-changes
  Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: 4f872e99736a2242a86b234af32d603b84956352
  
https://github.com/Perl/perl5/commit/4f872e99736a2242a86b234af32d603b84956352
  Author: Paul "LeoNerd" Evans 
  Date:   2024-04-14 (Sun, 14 Apr 2024)

  Changed paths:
M pod/perlexperiment.pod

  Log Message:
  ---
  perlexperiment.pod: Only certain functions in builtin now provoke 
experimental warnings


  Commit: f68e811c013f196ff2eabbb21058e50acef62345
  
https://github.com/Perl/perl5/commit/f68e811c013f196ff2eabbb21058e50acef62345
  Author: Paul "LeoNerd" Evans 
  Date:   2024-04-14 (Sun, 14 Apr 2024)

  Changed paths:
M pod/perlexperiment.pod

  Log Message:
  ---
  perlexperiment.pod: Mention the 'class' feature


Compare: https://github.com/Perl/perl5/compare/1e3b3238f231...f68e811c013f

To unsubscribe from these emails, change your notification settings at 
https://github.com/Perl/perl5/settings/notifications