On 06/09/14 21:08, Janne Blomqvist wrote: > On Sun, Sep 7, 2014 at 12:51 AM, Jerry DeLisle <jvdeli...@charter.net> wrote: >> Hi, >> >> The attached patch adds a compile time check for negative unit numbers given >> in >> an INQUIRE statement. A new test case is provided and one updated. > > What about units opened with newunit= ? Those have negative unit > numbers. It seems strange that one wouldn't be allowed to inquire such > units? Or if that indeed is the case, I suggest it's a bug in the > standard (one can imagine such happening by forgetting to update > inquire constraints after adding newunit= in f2003). > > program negunit > implicit none > logical :: file_exists > integer :: u > open(newunit=u, file="test.dat") > inquire(unit=u, exist=file_exists) > write(*,*) u, file_exists > close(u, status="delete") > end program negunit >
I was thinking of the same issue. The front end patch is correct. But I need to work further on the run time side. NEWUNIT presents a particular problem. The INQUIRE should search the treap for the negative unit and if found, return true. Having the negative unit number by itself is not sufficient. I will work on the run time part next. Frontend OK? Jerry