develooper Front page | perl.perl5.changes | Postings from March 2023

[Perl/perl5] 47a1cf: t/op/sprintf2 - TODO some failing tests for %g.

From:
Yves Orton via perl5-changes
Date:
March 25, 2023 13:00
Subject:
[Perl/perl5] 47a1cf: t/op/sprintf2 - TODO some failing tests for %g.
Message ID:
Perl/perl5/push/refs/heads/yves/hpux_build_warning_suppression/fd1d8e-fdb5b9@github.com
  Branch: refs/heads/yves/hpux_build_warning_suppression
  Home:   https://github.com/Perl/perl5
  Commit: 47a1cfa96c4785998e9556f7e7bd6d1c5b3b90f3
      https://github.com/Perl/perl5/commit/47a1cfa96c4785998e9556f7e7bd6d1c5b3b90f3
  Author: Yves Orton <demerphq@gmail.com>
  Date:   2023-03-25 (Sat, 25 Mar 2023)

  Changed paths:
    M t/op/sprintf2.t

  Log Message:
  -----------
  t/op/sprintf2 - TODO some failing tests for %g.

On HPUX none of the usual methods for doing high precision %g seem to
work:

    Checking for an efficient way to convert floats to strings.
    Trying sprintf...
    sprintf() found.
    sprintf length mismatch:  Expected 55, got 38
    ...But sprintf didn't work as I expected.
    Trying gconvert...
    gconvert NOT found.
    Trying gcvt...
    gcvt() found.
    gcvt length mismatch:  Expected 55, got 38
    ...But gcvt didn't work as I expected.
    *** WHOA THERE!!! ***
    None of ( sprintf gconvert gcvt)  seemed to work properly.  I'll use sprintf.

So we can safely TODO these tests for now.

See: https://github.com/Perl/perl5/issues/20953#issuecomment-1478744988
and: https://github.com/Perl/perl5/issues/20953#issuecomment-1483814118

Fixes: #20953
And also some issues in: #20959


  Commit: 95c541568f9209903cd7eaa5032e048e9122229c
      https://github.com/Perl/perl5/commit/95c541568f9209903cd7eaa5032e048e9122229c
  Author: Yves Orton <demerphq@gmail.com>
  Date:   2023-03-25 (Sat, 25 Mar 2023)

  Changed paths:
    M dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm
    M dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS/Constants.pm
    M dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS/CountLines.pm
    M dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS/Eval.pm
    M dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS/Utilities.pm
    M dist/ExtUtils-ParseXS/lib/perlxs.pod
    M dist/ExtUtils-ParseXS/t/001-basic.t

  Log Message:
  -----------
  ExtUtils-ParseXS - silence warnings about unreached code in generated XS code

On HPUX we get a lot of:

"APItest.c", line 4004: warning #2111-D: statement is unreachable: PUTBACK

because people have used something like XSRETURN(1); and we generate
code that does PUTBACK; return; Adding a pragma to silence it makes the builds
happier;


  Commit: d6b5d03ace7e16f348eb3a51d7aa27766b54609e
      https://github.com/Perl/perl5/commit/d6b5d03ace7e16f348eb3a51d7aa27766b54609e
  Author: Yves Orton <demerphq@gmail.com>
  Date:   2023-03-25 (Sat, 25 Mar 2023)

  Changed paths:
    M regcomp.c

  Log Message:
  -----------
  regcomp.c - eliminate assignment in while condition

This gives covertiy heartburn, and also makes the HPUX compiler
whine. Reworking it so that it is a while 1 and the condition determines
if we break out of the loop resolves the heartburn and makes for more
readable code.


  Commit: 64f9b256ae3e29ba8c4d3e4f7e0a530e5246a240
      https://github.com/Perl/perl5/commit/64f9b256ae3e29ba8c4d3e4f7e0a530e5246a240
  Author: Yves Orton <demerphq@gmail.com>
  Date:   2023-03-25 (Sat, 25 Mar 2023)

  Changed paths:
    M numeric.c

  Log Message:
  -----------
  numeric.c - change logical && to bitwise & in nantype test

This appears to have been broken since 2015, found by HPUX compiler warnings:

    "numeric.c", line 927: warning #4277-D: logical AND with a constant, do you
          mean to use '&'?
                          !(nantype && IS_NUMBER_IN_UV)) {


  Commit: a9302d2ddac8c8d283a3ce131b48f1d2cef488b7
      https://github.com/Perl/perl5/commit/a9302d2ddac8c8d283a3ce131b48f1d2cef488b7
  Author: Yves Orton <demerphq@gmail.com>
  Date:   2023-03-25 (Sat, 25 Mar 2023)

  Changed paths:
    M dist/Devel-PPPort/PPPort_pm.PL
    M dist/Devel-PPPort/parts/inc/misc

  Log Message:
  -----------
  Devel-PPPort - deal with signed klen in check_HeUTF8

Some of the HV logic uses a negative key length to indicate utf8
keys, and this logic was using an unsigned keylength, which obviously
does not work


  Commit: 2b621ee7ebf9bd3c3cf198911262e429e55c879e
      https://github.com/Perl/perl5/commit/2b621ee7ebf9bd3c3cf198911262e429e55c879e
  Author: Yves Orton <demerphq@gmail.com>
  Date:   2023-03-25 (Sat, 25 Mar 2023)

  Changed paths:
    M perlio.c

  Log Message:
  -----------
  perlio.c - double cast PerlIO_lockcnt()

This avoids various warnings about alignment on HPUX.


  Commit: aa87e33265f3b09d243f3c60c421937ad6261c63
      https://github.com/Perl/perl5/commit/aa87e33265f3b09d243f3c60c421937ad6261c63
  Author: Yves Orton <demerphq@gmail.com>
  Date:   2023-03-25 (Sat, 25 Mar 2023)

  Changed paths:
    M util.c

  Log Message:
  -----------
  util.c - assign HS_GETXSVERLEN() to var before assert

This makes it easier to see the value with gdb, and also avoids an
assignment in the if condition body.


  Commit: da45f81f11db33d61a3f37c38f5a06d6fa01fe51
      https://github.com/Perl/perl5/commit/da45f81f11db33d61a3f37c38f5a06d6fa01fe51
  Author: Yves Orton <demerphq@gmail.com>
  Date:   2023-03-25 (Sat, 25 Mar 2023)

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

  Log Message:
  -----------
  util.c - avoid warning about truncated pointer value

This code is part of the fallback rng initialization, it should
only be used in odd circumstances, and it is intended to be "random"ish,
so the logic change should not be a problem.

This more or less reverts commit 4b4c4ab35e70f005167c863eae6d2003492c393c,
although the S_ptr_hash() now lives in util.c instead of hv.c.

Turns out having a decent pointer hash /is/ useful.


  Commit: fd70bc3387578fe399f993f12f6a7f06e7eabe96
      https://github.com/Perl/perl5/commit/fd70bc3387578fe399f993f12f6a7f06e7eabe96
  Author: Yves Orton <demerphq@gmail.com>
  Date:   2023-03-25 (Sat, 25 Mar 2023)

  Changed paths:
    M intrpvar.h

  Log Message:
  -----------
  intrpvar.h - silence deprcation warning on HPUX

We were already silencing it on GCC, so lets add HPUX to the party.
Unfortunately I have not figured out a way to have a nice neat define
for it like we have for GCC or MSVC. :-(

Silences this:
    "intrpvar.h", line 941: warning #3215-D: function "Perl_sv_nounlocking"
              (declared at line 5934 of "proto.h") was declared deprecated
      PERLVARI(I, unlockhook,       share_proc_t, PERL_UNLOCK_HOOK)
      ^

We probably should add the same for MSVC as well.


  Commit: da32773851599404fac91916d5188e8ce1970caf
      https://github.com/Perl/perl5/commit/da32773851599404fac91916d5188e8ce1970caf
  Author: Yves Orton <demerphq@gmail.com>
  Date:   2023-03-25 (Sat, 25 Mar 2023)

  Changed paths:
    M intrpvar.h

  Log Message:
  -----------
  intrpvar - ignore deprecated warning on MSVC as well


  Commit: b19e8a26330755f83aeed67cd4edb0d7d1d5b80a
      https://github.com/Perl/perl5/commit/b19e8a26330755f83aeed67cd4edb0d7d1d5b80a
  Author: Yves Orton <demerphq@gmail.com>
  Date:   2023-03-25 (Sat, 25 Mar 2023)

  Changed paths:
    M dist/threads/lib/threads.pm
    M dist/threads/threads.xs

  Log Message:
  -----------
  dist/threads - use pure pragma form of CLANG_DIAG_IGNORE in threads.xs

Otherwise on HPUX we get warnings

    "threads.xs", line 1057: warning #2111-D: statement is unreachable
          CLANG_DIAG_IGNORE_STMT(-Wthread-safety);


  Commit: ed761b44d9c4bdeb11b190d1591d55626dad9c8c
      https://github.com/Perl/perl5/commit/ed761b44d9c4bdeb11b190d1591d55626dad9c8c
  Author: Yves Orton <demerphq@gmail.com>
  Date:   2023-03-25 (Sat, 25 Mar 2023)

  Changed paths:
    M dist/threads-shared/lib/threads/shared.pm
    M dist/threads-shared/shared.xs

  Log Message:
  -----------
  threads-shared - use pure prgagma version of CLANG_DIAG_IGNORE

Otherwise HPUX complains about unreachable statements.

"shared.xs", line 707: warning #2111-D: statement is unreachable
        CLANG_DIAG_RESTORE_STMT;
        ^

This version should do the same thing, the only difference being
it doesnt allow a semicolon on the macro call.


  Commit: 16932cfd51606d7164e28c28c097ca5cec301671
      https://github.com/Perl/perl5/commit/16932cfd51606d7164e28c28c097ca5cec301671
  Author: Yves Orton <demerphq@gmail.com>
  Date:   2023-03-25 (Sat, 25 Mar 2023)

  Changed paths:
    M perl.h

  Log Message:
  -----------
  perl.h - show HAS_LONG_DOUBLE and HAS_STRTOLD as well as USE_LONG_DOUBLE

Makes it easier to debug long double issues.


  Commit: fdb5b9ba35633aeff8e41e73cf3bf2b8cff4b171
      https://github.com/Perl/perl5/commit/fdb5b9ba35633aeff8e41e73cf3bf2b8cff4b171
  Author: Yves Orton <demerphq@gmail.com>
  Date:   2023-03-25 (Sat, 25 Mar 2023)

  Changed paths:
    M hints/hpux.sh

  Log Message:
  -----------
  hints/hpux - only run d_strtold define override check on version < 11.23

I added a version check around the logic as the comment already says
that "In HP-UXes prior to 11.23 strtold() returned a HP-UX specific
union called long_double, not a C99 long double."

The logic did not check for the version mentioned in the comment, it
simply greped for something that is no longer present in the file:

    grep 'double strtold.const' /usr/include/stdlib.h

outputs nothing on HPUX version B.11.31.

But

    grep "double strtold" /usr/include/stdlib.h

outputs:

    extern long_double strtold __((const char * __restrict, char ** __restrict));
    extern long double strtold __((const char * __restrict, char ** __restrict));

on HPUX version B.11.31.


Compare: https://github.com/Perl/perl5/compare/fd1d8edfa037...fdb5b9ba3563



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About