diff options
author | fxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-11-17 12:46:57 +0000 |
---|---|---|
committer | fxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-11-17 12:46:57 +0000 |
commit | a20e9b770551b8f4943256934689c6c8bfecd35f (patch) | |
tree | b4222529fc4abf9ab78757cfd41d5b3ec666c05d /libgfortran/io/open.c | |
parent | 148ad152f2f6dad3160819dc6f471080d801d313 (diff) | |
download | gcc-a20e9b770551b8f4943256934689c6c8bfecd35f.tar.gz |
PR fortran/24892
* io/io.h (unit_access): Add ACCESS_APPEND.
* io/open.c (access_opt): Add APPEND value for ACCESS keyword.
(st_open): Use that new value to set the POSITION accordingly.
* gfortran.dg/open_access_append_1.f90: New test.
* gfortran.dg/open_access_append_2.f90: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@107119 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/io/open.c')
-rw-r--r-- | libgfortran/io/open.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libgfortran/io/open.c b/libgfortran/io/open.c index 203964b5dea..c3b5dde25ac 100644 --- a/libgfortran/io/open.c +++ b/libgfortran/io/open.c @@ -39,6 +39,7 @@ Boston, MA 02110-1301, USA. */ static const st_option access_opt[] = { {"sequential", ACCESS_SEQUENTIAL}, {"direct", ACCESS_DIRECT}, + {"append", ACCESS_APPEND}, {NULL, 0} }; @@ -486,6 +487,19 @@ st_open (void) generate_error (ERROR_BAD_OPTION, "Cannot use POSITION with direct access files"); + if (flags.access == ACCESS_APPEND) + { + if (flags.position != POSITION_UNSPECIFIED + && flags.position != POSITION_APPEND) + generate_error (ERROR_BAD_OPTION, "Conflicting ACCESS and POSITION " + "flags in OPEN statement"); + + notify_std (GFC_STD_GNU, + "Extension: APPEND as a value for ACCESS in OPEN statement"); + flags.access = ACCESS_SEQUENTIAL; + flags.position = POSITION_APPEND; + } + if (flags.position == POSITION_UNSPECIFIED) flags.position = POSITION_ASIS; |