https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66708
Gerhard Steinmetz gerhard.steinmetz.fort...@t-online.de changed:
What|Removed |Added
Severity|normal |enhancement
--- Comment #1 from Gerhard Steinmetz gerhard.steinmetz.fort...@t-online.de
---
Formatted read or write with no variable list needs a format (fmt)
string longer than one character.
This is checked already -- partly -- but very good, indeed.
Please take a look at the message text.
$ cat z_write_fmt_too_short_1.f90
program p
character(1), parameter :: fmt1 = '('
character(1) :: fmt2 = '('
write (*, fmt1)
write (*, fmt2)
write (*, '(')
end
$ gfortran -g -O0 -Wall -fcheck=all z_write_fmt_too_short_1.f90
z_write_fmt_too_short_1.f90:4:14:
write (*, fmt1)
1
Error: Unexpected end of format string in format string at (1)
z_write_fmt_too_short_1.f90:6:14: Error: Unexpected end of format string in
format string at (1)
---
$ cat z_write_fmt_too_short_0.f90
program p
character(1), parameter :: fmt1 = '('
character(1) :: fmt2 = '('
write (*, fmt1(1:0))
write (*, fmt2(1:0))
write (*, '')
end
$ gfortran z_write_fmt_too_short_0.f90
z_write_fmt_too_short_0.f90:4:13:
write (*, fmt1(1:0))
1
Error: Missing leading left parenthesis in format string at (1)
z_write_fmt_too_short_0.f90:6:13:
write (*, '')
1
Error: Missing leading left parenthesis in format string at (1)