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

            Bug ID: 66643
           Summary: Missing compilation error for formatted data transfer
                    without format
           Product: gcc
           Version: 5.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gerhard.steinmetz.fort...@t-online.de
  Target Milestone: ---

For read/write an io-unit that is an asterisk (*) identifies an
external unit that is preconnected for sequential formatted output.
Then a format (fmt) is needed. If not given, no warning or error
message at compile time now, but always an error at runtime. 
Unavoidable. I was wondering if this is standard conforming at all.


$ cat z_write_fmt_missing.f90
program p
   write (*) 1
   write (*) 'a'
end

$ gfortran -g -O0 -Wall -fcheck=all z_write_fmt_missing.f90
$ a.out
At line 2 of file z_write_fmt_missing.f90 (unit = 6, file = 'stdout')
Fortran runtime error: Missing format for FORMATTED data transfer


$ cat z_read_fmt_missing.f90
program p
   read (*) i
end

$ gfortran -g -O0 -Wall -fcheck=all z_read_fmt_missing.f90
$ a.out
At line 2 of file z_read_fmt_missing.f90 (unit = 5, file = 'stdin')
Fortran runtime error: Missing format for FORMATTED data transfer


An error message could/should be given at compile time.

Reply via email to