This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
io/sem.t: eliminate warnings
authorTony Cook <tony@develop-help.com>
Tue, 17 Nov 2020 04:59:44 +0000 (15:59 +1100)
committerTony Cook <tony@develop-help.com>
Tue, 24 Nov 2020 02:35:21 +0000 (13:35 +1100)
commitd43c116b2ae74ec1f3ed78829d4f3ca76f091390
tree5c2a08a6a9204a0f58add3736b8cc533ed8fa6b6
parente1902e4ac113e51aa730e03a2b1bc54ec96c371c
io/sem.t: eliminate warnings

This eliminates some warnings that semctl() (or other *ctl()) calls
might generate, and some warnings specific to io/sem.t:

- for IPC_STAT and GETALL, the current value of ARG is overwritten
  so making an undefined value warning for it nonsensical, so don't
  use SvPV_force().

- for other calls, ARG is either ignored, or in a behaviour
  introduced in perl 3 (along with the ops), treats the supplied
  value as an integer which is then converted to a pointer.  Rather
  than warning on an undef value which is most likely to be ignored
  we treat the undef as zero without the usual warning.

- always pass a number for SEMNUM in the test code

I didn't try to eliminate warning for non-numeric/undefined SEMNUM,
since while we know it isn't used by SETALL, GETALL, IPC_STAT and
IPC_SET, it may or may not be used by system defined *ctl() operators
such as SEM_INFO and SHM_LOCK on Linux.

fixes #17926
doio.c
t/io/sem.t