This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/52564] Accepts invalid: Missing I/O list after comma
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 12 Mar 2012 14:39:18 +0000
- Subject: [Bug fortran/52564] Accepts invalid: Missing I/O list after comma
- Auto-submitted: auto-generated
- References: <bug-52564-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52564
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |accepts-invalid, diagnostic
Status|UNCONFIRMED |NEW
Last reconfirmed| |2012-03-12
CC| |burnus at gcc dot gnu.org
Ever Confirmed|0 |1
--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-03-12 14:39:18 UTC ---
Confirm. I tried 5 other compilers and all (but g95) report unconditionally an
error.
>From the standard:
R912 print-stmt is PRINT format [ , output-item-list ]
Thus, without the comma, i.e.
PRINT *
the program is valid.
* * *
>From io.c:
match_io (io_kind k)
...
get_io_list:
...
if (gfc_match_eos () != MATCH_YES)
{
if (comma_flag && gfc_match_char (',') != MATCH_YES)
...
m = match_io_list (k, &io_code);
if (m == MATCH_ERROR)
goto cleanup;
if (m == MATCH_NO)
goto syntax;
If one looks at match_io_list, one finds:
if (gfc_match_eos () == MATCH_YES)
return MATCH_YES;