https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119502

--- Comment #4 from anlauf at gcc dot gnu.org ---
(In reply to Jerry DeLisle from comment #3)
> I am curious what other compilers do with this.
> 
> program foo
>   integer :: iun = -1
>   open (iun)
>   write(iun,*) "This is a test."
>   close (iun)
> end

Well, here you go:

NAG:

Runtime Error: pr119502.f90, line 3: Unit number -1 out of range
Program terminated by fatal I/O error
Abort

Intel:

 This is a test.

Nvidia (nvfortran) and AMD flang:

FIO-F-212/OPEN/unit=-1/invalid unit number.
 In source file pr119502.f90, at line number 3

Reply via email to