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

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

From:
Yves Orton via perl5-changes
Date:
March 29, 2023 12:55
Subject:
[Perl/perl5] 663830: perl.h - silence certain warnings on HPUXglobally.
Message ID:
Perl/perl5/push/refs/heads/blead/e945ef-d31803@github.com
  Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: 663830b3656805dfa9415c7fb5ba22096f1b03b3
      https://github.com/Perl/perl5/commit/663830b3656805dfa9415c7fb5ba22096f1b03b3
  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: b292ecb4e4450921a8424ad87000f49bd9c858de
      https://github.com/Perl/perl5/commit/b292ecb4e4450921a8424ad87000f49bd9c858de
  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: 44eb4cdc274114db740861e4a116ffce3371d70f
      https://github.com/Perl/perl5/commit/44eb4cdc274114db740861e4a116ffce3371d70f
  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: 19ed09803687be5ff50321b9acf3053b5ce80215
      https://github.com/Perl/perl5/commit/19ed09803687be5ff50321b9acf3053b5ce80215
  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: c9bcbc57be3bba2d29d280f4a30fae62fc5bf48f
      https://github.com/Perl/perl5/commit/c9bcbc57be3bba2d29d280f4a30fae62fc5bf48f
  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

The return statement could never be reached as the while loop
is while(1) and there is no break statement inside of it. This
patch replaces the 'return arg;' with a NOT_REACHED; assertion,
just in case someone does add a break later on without thinking.


  Commit: d3eb75f09d0fc0005b3a7e16f3742854fe3899f4
      https://github.com/Perl/perl5/commit/d3eb75f09d0fc0005b3a7e16f3742854fe3899f4
  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: b22f2577edce6f40d11ab38436aa601bdbaba63b
      https://github.com/Perl/perl5/commit/b22f2577edce6f40d11ab38436aa601bdbaba63b
  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: fe67e58303186e966b34e7dbff135b02fbef325e
      https://github.com/Perl/perl5/commit/fe67e58303186e966b34e7dbff135b02fbef325e
  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: cb6188df375141f4ec9f33cc918fd640b1ff81b6
      https://github.com/Perl/perl5/commit/cb6188df375141f4ec9f33cc918fd640b1ff81b6
  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: ea35cd23e9d1405ff9dda3484cf2648c5332225e
      https://github.com/Perl/perl5/commit/ea35cd23e9d1405ff9dda3484cf2648c5332225e
  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: bbd6967b3d549a2e37beaf28fd6f68674f9322f2
      https://github.com/Perl/perl5/commit/bbd6967b3d549a2e37beaf28fd6f68674f9322f2
  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: 0589d99c19836db7d8fd519bbf404854ab56fe54
      https://github.com/Perl/perl5/commit/0589d99c19836db7d8fd519bbf404854ab56fe54
  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: 5b9055d9c8b2198297092151e33ddff52ef41b8c
      https://github.com/Perl/perl5/commit/5b9055d9c8b2198297092151e33ddff52ef41b8c
  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: 31d9da6590e36d49f32e1f9e4ec0681ee019de47
      https://github.com/Perl/perl5/commit/31d9da6590e36d49f32e1f9e4ec0681ee019de47
  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: 5de3c4299aeef2737ce02b6b2e401a997da32cff
      https://github.com/Perl/perl5/commit/5de3c4299aeef2737ce02b6b2e401a997da32cff
  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: fabf023f2ebd7d2d18332760db955889cb7a9d22
      https://github.com/Perl/perl5/commit/fabf023f2ebd7d2d18332760db955889cb7a9d22
  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: 3bce2dad3897a6791eb6d124f4b4a368a93d4cd5
      https://github.com/Perl/perl5/commit/3bce2dad3897a6791eb6d124f4b4a368a93d4cd5
  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: 55dc0196bb04b67e8268bba2bf900f129e4545d1
      https://github.com/Perl/perl5/commit/55dc0196bb04b67e8268bba2bf900f129e4545d1
  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: a63f267202cdf27888060487da29a5b383da82c6
      https://github.com/Perl/perl5/commit/a63f267202cdf27888060487da29a5b383da82c6
  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: a4b63cacf481771ef01a5bbd5fefc3a91d4bf6a7
      https://github.com/Perl/perl5/commit/a4b63cacf481771ef01a5bbd5fefc3a91d4bf6a7
  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: 35fdbb434ff05bb3be7f7c3f956f56e1062f0cda
      https://github.com/Perl/perl5/commit/35fdbb434ff05bb3be7f7c3f956f56e1062f0cda
  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: 8134806cbd3d2297882b1eaf70c08d299aaa5acb
      https://github.com/Perl/perl5/commit/8134806cbd3d2297882b1eaf70c08d299aaa5acb
  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: 4f5b68afbae99403486dc3e76f23f775fd9587c6
      https://github.com/Perl/perl5/commit/4f5b68afbae99403486dc3e76f23f775fd9587c6
  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: 3cfe6d102c50c7cdd639b841ad10a8a86cc2cbbb
      https://github.com/Perl/perl5/commit/3cfe6d102c50c7cdd639b841ad10a8a86cc2cbbb
  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: a030daf270f04b14c0b75d5da79bbef6e7038de1
      https://github.com/Perl/perl5/commit/a030daf270f04b14c0b75d5da79bbef6e7038de1
  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: 55a4ed45c550acec2a3344e99c853bc457515295
      https://github.com/Perl/perl5/commit/55a4ed45c550acec2a3344e99c853bc457515295
  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: d31803ec1abbb4a62f5d68ccd4d3efe312c0cefa
      https://github.com/Perl/perl5/commit/d31803ec1abbb4a62f5d68ccd4d3efe312c0cefa
  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/e945ef1bb856...d31803ec1abb



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