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

[Perl/perl5] 5fc9ca: perl.h - silence certain warnings on HPUXglobally.

From:
Yves Orton via perl5-changes
Date:
March 29, 2023 08:30
Subject:
[Perl/perl5] 5fc9ca: perl.h - silence certain warnings on HPUXglobally.
Message ID:
Perl/perl5/push/refs/heads/yves/hpux_build_warning_suppression/d82c5b-cc9820@github.com
  Branch: refs/heads/yves/hpux_build_warning_suppression
  Home:   https://github.com/Perl/perl5
  Commit: 5fc9cae41ca6beabb76d0642385d529ddaa32aaa
      https://github.com/Perl/perl5/commit/5fc9cae41ca6beabb76d0642385d529ddaa32aaa
  Author: Yves Orton <demerphq@gmail.com>
  Date:   2023-03-29 (Wed, 29 Mar 2023)

  Changed paths:
    M handy.h
    M perl.h

  Log Message:
  -----------
  perl.h - silence certain warnings on HPUX globally.

There are two warnings classes which account for a very large number of
the warnings produced when building on HPUX Itanium. We know the cause
of these warnings and we are ok with ignoring them.

One set comes from our memory wrap checks, where we end up doing a
comparison against constants in certain conditions. See the comments in
handy.h line 2723 related to PERL_MALLOC_WRAP.

The other set comes from our common "trick" of doing OO in C code with
casting. This is the foundation of how we manage SV types and how we
manage regular expression ops (regops).

If this logic really was a problem then we would have lots of test
failures and segfaults, and we do not, so we can silence them.


  Commit: 0fc39f8f8906a3aa684f0e9b0df4062ce9dea72e
      https://github.com/Perl/perl5/commit/0fc39f8f8906a3aa684f0e9b0df4062ce9dea72e
  Author: Yves Orton <demerphq@gmail.com>
  Date:   2023-03-29 (Wed, 29 Mar 2023)

  Changed paths:
    M regcomp.h

  Log Message:
  -----------
  regcomp.h - use different struct member names for U8 vs U32 str_len

It is confusing to have two different members, at different struct
offsets and with different sizes, with the same name. So rename them
so they have different names that include their size so it is obvious
what is going on.


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

  Changed paths:
    M regcomp.c
    M regcomp.h
    M regcomp_debug.c
    M regcomp_study.c
    M regcomp_trie.c
    M regexec.c
    M regexp.h

  Log Message:
  -----------
  regcomp.h - use a common union for head and args across all regnodes.

This helps with HPUX builds where we need to ensure everything
is aligned the same (on 32 bit boundaries). It also strongly
encourages everything to use the accessor macros and not access
the members directly.

By using a union for the variadic fields we make it more obvious
that some regops use the field in different ways. This patch
also converts all the arg unions into a standardized union with
standardized member names.


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

  Changed paths:
    M peep.c

  Log Message:
  -----------
  peep.c - ensure deferred_queue is initialized before use

HPUX was warning that it can be used before it is initialized.
There is no cost to nulling it out early so do so.


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

  Changed paths:
    M op.c

  Log Message:
  -----------
  op.c - deal with not-reached statement warning

Change this to test on o, and if it goes null to panic.

We used to assume that o was a valid pointer and loop infinitely,
but this meant that the old return statement at the bottom of
function was never reached.


  Commit: 0fd5021559a31c069cf2eed0e5671558314b36c0
      https://github.com/Perl/perl5/commit/0fd5021559a31c069cf2eed0e5671558314b36c0
  Author: Yves Orton <demerphq@gmail.com>
  Date:   2023-03-29 (Wed, 29 Mar 2023)

  Changed paths:
    M pp_sys.c

  Log Message:
  -----------
  pp_sys.c - suppress warning about comparison to unsigned value


  Commit: 72054e2869e0b0195f7dc09737d971ad6cadfd1c
      https://github.com/Perl/perl5/commit/72054e2869e0b0195f7dc09737d971ad6cadfd1c
  Author: Yves Orton <demerphq@gmail.com>
  Date:   2023-03-29 (Wed, 29 Mar 2023)

  Changed paths:
    M regcomp.c

  Log Message:
  -----------
  regcomp.c - simplify logic to eliminate unreached code

We always goto out of this if, so eliminate the unreached code
and also eliminate the useless else block.


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

  Changed paths:
    M regexec.c

  Log Message:
  -----------
  regexec.c - mark the bottom of a sub as never reached

We used to have a return statement here that picky compilers
would complain about.


  Commit: 7de7c398422c9735f8322a71b9efb7f7caab5dc4
      https://github.com/Perl/perl5/commit/7de7c398422c9735f8322a71b9efb7f7caab5dc4
  Author: Yves Orton <demerphq@gmail.com>
  Date:   2023-03-29 (Wed, 29 Mar 2023)

  Changed paths:
    M hv.c
    M perl.c
    M sv.c

  Log Message:
  -----------
  sv.c - don't cast SVTYPEMASK to svtype, use SvIS_FREED() instead.

svtype is an enum with 18 values. SVTYPEMASK is 31. A picky compiler
(like on HPUX) will complain that casting 31 to a svtype is an error.

We have SvIS_FREED() to do this properly anyway.


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

  Changed paths:
    M Porting/cmpVERSION.pl

  Log Message:
  -----------
  Porting/cmpVERSION.pl - deal with old git clients better in tag date parsing

The HPUX box we smoke on does not have a modern git and chokes
on taggerdate:unix, so we use taggerdata:iso8601 instead, and
then parse the date with Time::Local.


  Commit: 437130df0873a7518988d90fec3786a42ad8db82
      https://github.com/Perl/perl5/commit/437130df0873a7518988d90fec3786a42ad8db82
  Author: Yves Orton <demerphq@gmail.com>
  Date:   2023-03-29 (Wed, 29 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: ccad83dd84b47fdeb194a96f5417fb77a1d7c911
      https://github.com/Perl/perl5/commit/ccad83dd84b47fdeb194a96f5417fb77a1d7c911
  Author: Yves Orton <demerphq@gmail.com>
  Date:   2023-03-29 (Wed, 29 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: 77fea146adc1075f20c0ade9b06a6b7168db9f80
      https://github.com/Perl/perl5/commit/77fea146adc1075f20c0ade9b06a6b7168db9f80
  Author: Yves Orton <demerphq@gmail.com>
  Date:   2023-03-29 (Wed, 29 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: 56c30b2266d077f06d372eac03aabc83d765603e
      https://github.com/Perl/perl5/commit/56c30b2266d077f06d372eac03aabc83d765603e
  Author: Yves Orton <demerphq@gmail.com>
  Date:   2023-03-29 (Wed, 29 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: 8e6e7722c938f6118b92f45e6f02070b64e6e9a8
      https://github.com/Perl/perl5/commit/8e6e7722c938f6118b92f45e6f02070b64e6e9a8
  Author: Yves Orton <demerphq@gmail.com>
  Date:   2023-03-29 (Wed, 29 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: 21e7487244673bb0a5c23ba4f6b42db126102ecf
      https://github.com/Perl/perl5/commit/21e7487244673bb0a5c23ba4f6b42db126102ecf
  Author: Yves Orton <demerphq@gmail.com>
  Date:   2023-03-29 (Wed, 29 Mar 2023)

  Changed paths:
    M perlio.c

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

This avoids various warnings about alignment on HPUX.


  Commit: 1172a01cdc049d307139d290eb03a03b000c22b1
      https://github.com/Perl/perl5/commit/1172a01cdc049d307139d290eb03a03b000c22b1
  Author: Yves Orton <demerphq@gmail.com>
  Date:   2023-03-29 (Wed, 29 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: 80ff2dc9f95d07b67f463b85a20c2b366805d8d0
      https://github.com/Perl/perl5/commit/80ff2dc9f95d07b67f463b85a20c2b366805d8d0
  Author: Yves Orton <demerphq@gmail.com>
  Date:   2023-03-29 (Wed, 29 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: 0d0cd34f74dede83dece58250f40bbd89119899f
      https://github.com/Perl/perl5/commit/0d0cd34f74dede83dece58250f40bbd89119899f
  Author: Yves Orton <demerphq@gmail.com>
  Date:   2023-03-29 (Wed, 29 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: 6ac0db7fb534396c6ae3799486b35780cfd101e5
      https://github.com/Perl/perl5/commit/6ac0db7fb534396c6ae3799486b35780cfd101e5
  Author: Yves Orton <demerphq@gmail.com>
  Date:   2023-03-29 (Wed, 29 Mar 2023)

  Changed paths:
    M intrpvar.h

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


  Commit: 556337ec06d977f69e187e5370cdc89785ff0356
      https://github.com/Perl/perl5/commit/556337ec06d977f69e187e5370cdc89785ff0356
  Author: Yves Orton <demerphq@gmail.com>
  Date:   2023-03-29 (Wed, 29 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: 39270e4f2e7d43c6e47a8bf82182ccc90009e55b
      https://github.com/Perl/perl5/commit/39270e4f2e7d43c6e47a8bf82182ccc90009e55b
  Author: Yves Orton <demerphq@gmail.com>
  Date:   2023-03-29 (Wed, 29 Mar 2023)

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

  Log Message:
  -----------
  threads-shared - use pure pragma 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: f1cb67870b48d25b546fcd021f49b4b60ff374d9
      https://github.com/Perl/perl5/commit/f1cb67870b48d25b546fcd021f49b4b60ff374d9
  Author: Yves Orton <demerphq@gmail.com>
  Date:   2023-03-29 (Wed, 29 Mar 2023)

  Changed paths:
    M perl.c

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

Makes it easier to debug long double issues.


  Commit: 340e78960bfe7321246d89934ecefad4fb51ed1d
      https://github.com/Perl/perl5/commit/340e78960bfe7321246d89934ecefad4fb51ed1d
  Author: Yves Orton <demerphq@gmail.com>
  Date:   2023-03-29 (Wed, 29 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.


  Commit: 0ab1802d571dc5ce07db60a5773a82542cd27ffe
      https://github.com/Perl/perl5/commit/0ab1802d571dc5ce07db60a5773a82542cd27ffe
  Author: Yves Orton <demerphq@gmail.com>
  Date:   2023-03-29 (Wed, 29 Mar 2023)

  Changed paths:
    M t/porting/globvar.t

  Log Message:
  -----------
  t/porting/globvar.t - fix for HPUX

On HPUX `nm globals.o` produces output like this (without the indent):

    [5]    |                  2420|       2|OBJT |GLOB |0| .rodata|PL_Yes

So change the $define qr// to accommodate it.

We also have to TODO some of the tests, as HPUX seems to export
everything.


  Commit: 2642afae25fe38315064534266446581d153d037
      https://github.com/Perl/perl5/commit/2642afae25fe38315064534266446581d153d037
  Author: Yves Orton <demerphq@gmail.com>
  Date:   2023-03-29 (Wed, 29 Mar 2023)

  Changed paths:
    M Porting/Maintainers.pl
    M t/porting/customized.dat

  Log Message:
  -----------
  Porting/maintainers.pl - remove Net-Ping customized files

Net-Ping is in dist/ which means we are upstream, so there should
not be any customized files.


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

  Changed paths:
    M dist/Net-Ping/lib/Net/Ping.pm
    M dist/Net-Ping/t/450_service.t

  Log Message:
  -----------
  dist/Net-Ping - remove HPUX from the exclusions list in 450_service.t

We pass these tests just fine on HPUX 11.31.


Compare: https://github.com/Perl/perl5/compare/d82c5b5797b1...cc9820719793



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