This is the mail archive of the gcc-patches@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]

Re: [patch, fortran]PR25829 Add support for F2003 I/O features


> - the matchers and checks for asynchronous, decimal, encoding,
> pending, round, sign, size, id for OPEN, READ, WRITE, and INQUIRE.
> - New WAIT statement.


Remarks regarding diagnostics in the front end
(Might go beyond your patch and might also regarding unimplemented
things.)

You should add checks which reject those with -std=f95: Both WAIT and
DECIMAL= etc. are accepted with -std=f95.

You should add checks for the arguments, the following is not rejected:
  write(99,asynchronous='yesS')
(They are checked for OPEN not for READ/WRITE)

The following is invalid. Asynchronous I/O is only allowed if io-unit is
a file-unit-number (C925):
  character(10) :: aa
  WRITE(aa,'(a)',asynchronous='yes')

The following is rejected because the ID= is not recognized:
   WRITE(99,asynchronous='no',id=j)
(It should be rejected since ID= is invalid for asynchronous='NO')

The following is invalid:
  WRITE(99,decimal="comma")
The reasons is that only formatted I/O (including namelists) are allowed
when DECIMAL=, BLANK= (blank is actually not recognized!), PAD=, SIGN=
or ROUND= appear. (C928).

For completeness:
  WRITE(99,'(a)',delim="zero")
this is rejected since DELIM= does not seem to be recognized, but the
example is also wrong: DELIM= is only valid for * or namelists.

> - implements the DECIMAL= feature.
It would be great if (e.g. in a follow up patch) you could also support
DP and DC:
  write(*,'(DP,e12.4,DC,e12.4)')  1.2, 1.3
(currently, they are already rejected by the front end)

> - implements a do nothing stub for the WAIT statement.
(The Fortran 2003 permits the use of synchronous I/O thus this is OK; but
it should be in the release notes. Unless, your full implementation is
almost ready to go in.)

I'm inclined to having encoding=, round=, size= rejected with a not-
implemented message (e.g. using sorry() of toplev.h or eith gfc_error).


The rest looked ok, though I have only skimmed over the libgfortran
part.


Tobias


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