FIX: F6100 Reading Maximal Negative Integers

Last reviewed: September 16, 1997
Article ID: Q104896
1.00 1.00a | 1.00
MS-DOS     | WINDOWS NT
kbprg kbfixlist kberrmsg

The information in this article applies to:

  • Microsoft FORTRAN PowerStation for MS-DOS versions 1.0 and 1.0a
  • Microsoft FORTRAN PowerStation 32 version 1.0

SYMPTOMS

For any integer data type, reading the smallest negative integer of that range generates the run-time error F6100 indicating that there was an INTEGER overflow on input.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem was corrected in Microsoft FORTRAN PowerStation 32, version 4.0.

MORE INFORMATION

The smallest negative integer for each integer data type is:

          -128  Integer*1
        -32768  Integer*2
   -2147483648  Integer*4

The sample code below generates the 6100 error for all integer types when compiled with PowerStation, but only generates the 6100 error for integer*4 with FORTRAN 5.1 and earlier.

Sample Code

C No Compiler options needed

      integer*1 i
      integer*2 j
      integer*4 k
      open(1,file='test.dat')
      do 10 n=3,5
        write(1,*) -2**((2**n-1))
 10   continue

      rewind(1)
      read(1,*,iostat=ierr) i
      if(ierr.eq.6100) then
        print*, 'error reading integer*1 was: ',ierr
      else
        print*, 'integer*1 input: ',i
      end if

      read(1,*,iostat=ierr) j
      if(ierr.eq.6100) then
        print*, 'error reading integer*2 was: ',ierr
      else
        print*, 'integer*2 input: ',j
      end if

      read(1,*,iostat=ierr) k
      if(ierr.eq.6100) then
        print*, 'error reading integer*4 was: ',ierr
      else
        print*, 'integer*4 input: ',k
      end if

      end


Additional reference words: 1.00 5.10
KBCategory: kbprg kbfixlist kbbuglist kberrmsg
KBSubcategory: FORTLngIss
Keywords : FORTLngIss kbbuglist kberrmsg kbfixlist kbprg
Version : 1.00 1.00a | 1.00
Platform : MS-DOS NT WINDOWS
Solution Type : kbfix


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: September 16, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.