Operating System - OpenVMS
1827811 Members
2051 Online
109969 Solutions
New Discussion

Re: Difference in Itanium and Alpha Basic error handling

 
Jonathan Cronin
Advisor

Difference in Itanium and Alpha Basic error handling

! This program fails (signals an error) on Itanium
! and exits cleanly on Alpha
! Both OPenVMS 8.3, Basic v1.6

call inner

end


function long inner

option handle=severe

%include "$SSDEF" %from %library "SYS$SHARE:BASIC$STARLET"

when error in
call lib$signal( SS$_ABORT by value )
exit function 1
use
exit handler unless vmsstatus = SS$_ABORT
print "Caught abort: "; vmsstatus
end when

end function 0
2 REPLIES 2
Hein van den Heuvel
Honored Contributor

Re: Difference in Itanium and Alpha Basic error handling

Nice concise reproducer. Thanks.
Looks like a bug. Report to HP.

The program may be right, but it feels wrong to me. It declares a function 'inner' and then calls it as a function, with no return value. That may be legit but I don't like it myself, and the compiler agrees...
If you change the code to i%=inner it works on both platforms.

Then again... if you change the code to 'sub inner'... 'exit sub' and 'return sub' the problem stays. So something is wrong and worth reporting officially.

fwiw,
Hein.
Jonathan Cronin
Advisor

Re: Difference in Itanium and Alpha Basic error handling

Interesting. I was going to claim that the bug had occured with a function call (like sts = inner ) since we "deprecate" the use of call, but went back to the code before I distilled it down, and the original usage was a "call" generated by an automated test-wrapper.

I expect there's a lot of code out there that "call"s functions.