[13117] in Athena Bugs
sun4 7.7N: /usr/athena/lib/perl/sys/socket.ph
daemon@ATHENA.MIT.EDU (Albert Dvornik)
Mon Jan 23 07:29:18 1995
To: bugs@MIT.EDU
Date: Mon, 23 Jan 1995 07:29:11 EST
From: Albert Dvornik <bert@MIT.EDU>
System name: infocalypse
Type and version: SPARC/Classic 7.7N (1 update(s) to same version)
Display type: cgthree
Can you give me the short form?
Apply the patch included at the end of this bug report.
Can you give me the long form?
Read on.
What were you trying to do?
require 'sys/socket.ph' in a Perl script.
What's wrong:
Perl reports:
Undefined subroutine "main'INTEL" called at
/usr/athena/lib/perl/sys/socket.ph line 100.
This is because the Solaris /usr/include/sys/socket.h contains
the following line, which is illegaly formed (by ANSI C spec)
if INTEL or ATT are undefined:
#if (INTEL == 31) || (ATT == 31)
This line gets translated to the following line in socket.ph:
if (( &INTEL == 31) || ( &ATT == 31)) {
which is illegal if INTEL or ATT weren't defined as procedures.
What should have happened:
People who brought us Solaris should have been dragged out
onto the superhighway and shot. Barring that, socket.ph brain
damage should have been fixed.
Please describe any relevant documentation references:
The following patch will remove the problem while keeping the
intended functionality.
*** /usr/athena/lib/perl/sys/socket.ph Fri Jun 17 14:09:16 1994
--- socket.ph Mon Jan 23 07:04:18 1995
***************
*** 97,103 ****
local($opt) = @_;
eval "(($opt + 1))";
}';
! if (( &INTEL == 31) || ( &ATT == 31)) {
eval 'sub SOCKETSYS {88;}';
}
else {
--- 97,103 ----
local($opt) = @_;
eval "(($opt + 1))";
}';
! if (( eval{&INTEL} == 31) || ( eval{&ATT} == 31)) {
eval 'sub SOCKETSYS {88;}';
}
else {