[3413] in testers
perl5 & Irix 6.3: error in sys/types.ph
daemon@ATHENA.MIT.EDU (Jacob Morzinski)
Sun Mar 29 02:26:02 1998
To: perldev@MIT.EDU
Cc: testers@MIT.EDU
Date: Sun, 29 Mar 1998 02:25:52 EST
From: "Jacob Morzinski" <jmorzins@MIT.EDU>
This one-liner produces warnings (as well as output) on Irix 6.3:
% /mit/perl5/perl -e 'use Sys::Hostname; print &hostname(),"\n"'
Number found where operator expected at (eval 39) line 1, near ")0"
(Missing operator before 0?)
oliver
%
Although I'm testing this on Athena 8.1 with the perl5 locker, I
suspect that Athena 8.2 will have the same problem.
The error can be traced back to sys/types.ph, which tries to
define the subroutine
sub P_MYPID () {(( &pid_t)0);}
Things work if the "0" is parenthesized:
sub P_MYPID () {(( &pid_t)(0));}
I've included a patch for
/mit/perl5/arch/sgi_63/lib/perl5.004/site_perl/sys/types.ph.
-Jacob
--- /mit/perl5/arch/sgi_63/lib/perl5.004/site_perl/sys/types.ph Tue Feb 10 00:37:08 1998
+++ /tmp/types.ph Sat Mar 28 22:17:21 1998
@@ -101,7 +101,7 @@
if (!defined &NODEV) {
eval 'sub NODEV () {( &dev_t)(-1);}' unless defined(&NODEV);
}
- eval 'sub P_MYPID () {(( &pid_t)0);}' unless defined(&P_MYPID);
+ eval 'sub P_MYPID () {(( &pid_t)(0));}' unless defined(&P_MYPID);
eval 'sub P_MYHOSTID () {(-1);}' unless defined(&P_MYHOSTID);
}
if (( (defined(&_NO_POSIX) ? &_NO_POSIX : 0) & (defined(&_NO_XOPEN4) ? &_NO_XOPEN4 : 0)) || defined( &_BSD_TYPES) || defined( &_BSD_COMPAT)) {