https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61933
Bug ID: 61933
Summary: Inquire on internal units
Product: gcc
Version: 4.10.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: Joost.VandeVondele at mat dot ethz.ch
It would be nice if the the following code
> cat test.f90
LOGICAL :: file_exists
INQUIRE(UNIT=-1,EXIST=file_exists)
WRITE(6,*) file_exists
END
would error out at runtime, since
F2008:
If le-unit-number identies an internal unit (9.6.4.8.3), an error condition
occurs.
F2003:
The value of file-unit-number shall be nonnegative or equal to one of the named
constants INPUT UNIT,
9 OUTPUT UNIT, or ERROR UNIT of the ISO FORTRAN ENV intrinsic module (13.8.2).
The Cray compiler generates an error in this case:
lib-4017 : UNRECOVERABLE library error
The INQUIRE statement must not specify an internal file.