This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/52564] Accepts invalid: Missing I/O list after comma


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;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]