[PATCH, Fortran] DEC Compatibility: New I/O Specifiers CARRIAGECONTROL, READONLY, SHARE with -fdec

Jerry DeLisle jvdelisle@charter.net
Wed Oct 26 03:36:00 GMT 2016

On 10/25/2016 11:52 AM, Fritz Reese wrote:
> All,
> Here's the big one. This patch proposes an extension to both the GNU
> Fortran front-end and runtime library (libgfortran) to support three
> additional I/O specifiers: CARRIAGECONTROL, READONLY, and SHARE for
> compatibility with legacy compilers/code.
> Here's a summary of what the specifiers actually do:
> CARRIAGECONTROL is to control line termination settings between output records.
> READONLY implies ACTION='READ' and additionally prevents
> STATUS='DELETE' from deleting a file on CLOSE.
> SHARE provides OS-level locks.
> These specifiers are designed to match the syntax and behavior of
> legacy compilers. For more info see the attached test cases, source
> code, and documentation.
> Each comes with an IOPARM_OPEN_ bit, and CC+SHARE have IOPARM_INQUIRE_
> bits. The st_parameter_dt structure needs an additional two bytes to
> propagate information with CARRIAGECONTROL='FORTRAN'. These two bytes
> still leave plenty of trailing 'pad' for future expansion.
> Bootstraps and regtests on x86_64-redhat-linux. There's a fair bit to
> sift through, so feel free to ask for clarification or provide
> comments/constructive criticism.
> OK for trunk?

Patch applies with a few minor offsets, regression tests OK, indentation looks 
good. Test cases are thorough. I appreciate that you guarded the open_share and 
close_share with the #if defined(HAVE_FCNTL) && defined(F_SETLK) && 
defined(F_UNLCK). I am pretty sure not all platforms will support these.

Good Job,

Yes, OK to commit.


More information about the Gcc-patches mailing list