The following should not produce a runtime error. OPEN(8, FORM = 'unformatted', STATUS = 'scratch') OPEN(8, FORM = 'unformatted', STATUS = 'scratch') end There may be other combinations of arguments to open that should not error, See the following thread: http://gcc.gnu.org/ml/fortran/2006-05/msg00307.html
If anyone else has started on this, let me know.
Subject: Bug number PR27704 A patch for this bug has been added to the patch tracker. The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2006-07/msg00006.html
Subject: Bug 27704 Author: jvdelisle Date: Tue Jul 4 01:36:31 2006 New Revision: 115168 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=115168 Log: 2006-07-03 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/27704 * runtime/error.c (notify_std): Pass common flags into function. Use flags to show locus of error or warning. * libgfortran.h: Add enum try. Add prototype for notify_std. * io/open.c (edit_modes): Allow status="old" and add extension to allow status="scratch" *io/list_read.c (nml_read_obj): Update call to notify_std. *io/io.h: Remove enum try and prototype for notify_std. *io/transfer.c (read_sf): Update call to notify_std. *io/format.c (parse_format_list): Update call to notify_std. Modified: trunk/libgfortran/ChangeLog trunk/libgfortran/io/format.c trunk/libgfortran/io/io.h trunk/libgfortran/io/list_read.c trunk/libgfortran/io/open.c trunk/libgfortran/io/transfer.c trunk/libgfortran/libgfortran.h trunk/libgfortran/runtime/error.c
Subject: Bug 27704 Author: jvdelisle Date: Tue Jul 4 01:47:26 2006 New Revision: 115169 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=115169 Log: 2006-07-03 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/27704 * gfortran.dg/open_status_3.f90: New test. * gfortran.dg/fmt_l.f90: Update for new feature. Added: trunk/gcc/testsuite/gfortran.dg/open_status_3.f90 Modified: trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/gfortran.dg/fmt_l.f90
Fixed on 4.2 only. If someone wants this on 4.1 let me know.