[patch, fortran]PR25829 Add support for F2003 I/O features
Jerry DeLisle
jvdelisle@verizon.net
Tue Apr 1 04:31:00 GMT 2008
On Sat, 2008-03-29 at 14:44 +0100, Tobias Burnus wrote:
> > - 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 attached updated patch incorporates all constraints and checks
listed above in the front end. It also implements the DP and DC format
specifiers.
If not noticed before, I had an ID= specifier for the OPEN statement.
There is no such thing, so I have deleted that cute feature. Also, the
ID= is suppose to work similarly to IOSTAT only in two directions. The
value set in the transfer statement such as READ or WRITE and then that
variable is intened to be used in subsequent WAIT statements. I think I
have it fixed, but will study that some more. :)
Please give it a spin and test if you can. Any test cases people are
willing to submit would be welcome.
At this point I will begin to work on run time library side stuff and
fix any additional front end problems identified as we continue on here.
Help with testing much appreciated. Regression tested on
x86-64-linux-gnu.
Jerry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: f2003-io-RevE.diff
Type: text/x-patch
Size: 70779 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20080401/c92895b2/attachment.bin>
More information about the Fortran
mailing list