[Info-vax] DCL Integer Overflow

Arne Vajhøj arne at vajhoej.dk
Sun Jul 2 16:14:40 EDT 2017


On 7/2/2017 11:45 AM, Scott Dorsey wrote:
>   <VAXman-  @SendSpamHere.ORG> wrote:
>> In article <oj8oc5$8s5$1 at panix2.panix.com>, kludge at panix.com (Scott Dorsey) writes:
>>> On 6/30/2017 5:06 AM, GerMarsh wrote:
>>>> I know that there have been a few discussions about
>>>> enhancing/replacing DCL, but I wonder if someone will fix the old
>>>> integer overflow which has been there since the year dot...
>>>>
>>>> $ int=%x7fffffff
>>>> $ sho sym int
>>>>     INT = 2147483647   Hex = 7FFFFFFF  Octal = 17777777777
>>>> $ int=int+1
>>>> $ sho sym int
>>>>     INT = -2147483648   Hex = 80000000  Octal = 20000000000
>>>
>>> This is not a bug, it's a feature.
>>> If you don't want it to roll over, what DO you want it to do?
>>> Halt with an error?
>>
>> Halt and Catch Fire!
>>
>> In need of real math?  Use Fortran!
> 
> Fortran doesn't allow me to pitch an exception on integer overflow either,
> does it?  I can do it on a float, but with integers I need to check explicitly
> before every operation.

I don't think the standard did/do.

But on VMS sure.

With the code posted a minute ago:

$ for/old/warn=all intovf.for /check=over
$ link intovf
$ run intovf
   2147483647    7FFFFFFF 17777777777
%SYSTEM-F-HPARITH, high performance arithmetic trap, Imask=00000001, 
Fmask=00000
000, summary=40, PC=00000000000300A8, PS=0000001B
-SYSTEM-F-INTOVF, arithmetic trap, integer overflow at 
PC=00000000000300A8, PS=0
000001B
%TRACE-F-TRACEBACK, symbolic stack dump follows
   image    module    routine             line      rel PC           abs PC
  INTOVF  INTOVF  INTOVF                     5 00000000000000A8 
00000000000300A8
                                             0 FFFFFFFF8037FC44 
FFFFFFFF8037FC44
%TRACE-I-END, end of TRACE stack dump

Arne




More information about the Info-vax mailing list