diff options
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/open_status_2.f90 | 12 | ||||
-rw-r--r-- | libgfortran/ChangeLog | 5 | ||||
-rw-r--r-- | libgfortran/io/open.c | 5 |
4 files changed, 25 insertions, 2 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 99342b2..4f73095 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2005-11-26 Janne Blomqvist <jb@gcc.gnu.org> + + PR libgfortran/24945 + * gfortran.dg/open_status_2.f90: New test. + 2005-11-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> * gcc.c-torture/execute/builtins/fprintf.c, diff --git a/gcc/testsuite/gfortran.dg/open_status_2.f90 b/gcc/testsuite/gfortran.dg/open_status_2.f90 new file mode 100644 index 0000000..8b4b577 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/open_status_2.f90 @@ -0,0 +1,12 @@ +! { dg-do run } +! PR 25036 +! Test reopening file without status specifier or with +! status='unknown'. The standard says that these two must behave +! identically, but the actual behaviour is processor dependent. +program open_status_2 + open(10, file="f", form='unformatted', status='unknown') + open(10, file="f", form='unformatted', status='unknown') + open(10, file="f", form='unformatted') + close(10, status='delete') +end program open_status_2 + diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index a637ee47..03629e2 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,8 @@ +2005-11-26 Janne Blomqvist <jb@gcc.gnu.org> + + PR libgfortran/24945 + * io/open.c (edit_modes): Check for STATUS_UNKNOWN flag. + 2005-11-25 Richard Henderson <rth@redhat.com> * io/list_read.c (nml_parse_qualifier): Use memcpy to extract diff --git a/libgfortran/io/open.c b/libgfortran/io/open.c index 5459509..7e42cc6 100644 --- a/libgfortran/io/open.c +++ b/libgfortran/io/open.c @@ -144,9 +144,10 @@ edit_modes (st_parameter_open *opp, gfc_unit * u, unit_flags * flags) /* Status must be OLD if present. */ - if (flags->status != STATUS_UNSPECIFIED && flags->status != STATUS_OLD) + if (flags->status != STATUS_UNSPECIFIED && flags->status != STATUS_OLD && + flags->status != STATUS_UNKNOWN) generate_error (&opp->common, ERROR_BAD_OPTION, - "OPEN statement must have a STATUS of OLD"); + "OPEN statement must have a STATUS of OLD or UNKNOWN"); if (u->flags.form == FORM_UNFORMATTED) { |