[PATCH] Tighten up checks for ASSIGN statement

Tobias Schlüter tobias.schlueter@physik.uni-muenchen.de
Mon Dec 6 12:42:00 GMT 2004


Tobias Schlüter wrote:
> Steve Kargl wrote:
> 
>>Does g77 accept non-default kind?  I just fixed the ibset et al
>>functions to be compatiable with g77.
> I will check this tomorrow in any case.

[tobi@marktplatz tests]$ cat assign.f
      integer*2 i2
      integer*8 i8

      assign 100 to i2
      assign 100 to i8
 100  continue
      end
[tobi@marktplatz tests]$ g77 assign.f
assign.f: In program `MAIN__':
assign.f:4:
         assign 100 to i2
                       ^
Expression at (^) has incorrect data type or rank for its context
assign.f:5:
         assign 100 to i8
                       ^
Expression at (^) has incorrect data type or rank for its context
assign.f:4: error: ASSIGN to variable that is too small
assign.f:5: error: ASSIGN to variable that is too small
[tobi@marktplatz tests]$ ~/src/gcc/build-clean/gcc/f951 assign.f -w -quiet
 In file assign.f:4

      assign 100 to i2
                     1
Error: ASSIGN statement at (1) requires a scalar INTEGER*4 variable
 In file assign.f:5

      assign 100 to i8
                     1
Error: ASSIGN statement at (1) requires a scalar INTEGER*4 variable

... so g77 does indeed give an error, which is actually misleading in the
INTEGER*8 case.  So my patch is a definite enhancement over g77 :-)

- Tobi



More information about the Fortran mailing list