[PATCH] Fix for PR fortran/21375

Tobias Schlüter tobias.schlueter@physik.uni-muenchen.de
Sat Jun 4 22:30:00 GMT 2005


Steve Kargl wrote:
> You're right about the DEALLOCATE(a1,a2,stat=i) case above.  Unfortunately,
> I don't know how to fix this.  I assume that inside the for loop of
> gfc_trans_deallocate(), I need to check if pstat is set to 1 on each
> iteration and if so set a have_seen_problem flag.  Once the for loop
> exits, then check have_seen_problem and reset pstat with an appropriate
> value.  Any help would be appreciate (in that I don't understand the
> trans-*) file too well.

Since the stat variable is defined to be zero for success, and non-zero
otherwise, I think we could just set the user-supplied variable to zero before
we call deallocate, and then simply add the result to the user variable
instead of assigning it, effectively making the stat variable count the
unsuccessfull deallocations.

- Tobi



More information about the Fortran mailing list