This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Tighten up checks for ASSIGN statement


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]