re PR fortran/28335 (flush() / write() statement on closed units - error?)
authorJerry DeLisle <jvdelisle@gcc.gnu.org>
Mon, 31 Jul 2006 01:32:38 +0000 (01:32 +0000)
committerJerry DeLisle <jvdelisle@gcc.gnu.org>
Mon, 31 Jul 2006 01:32:38 +0000 (01:32 +0000)
2006-07-30  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

PR libgfortran/28335
* file_position.c (st_flush): Add clearer error when UNIT does not
exist. Add reference to standard in comment.

From-SVN: r115835

libgfortran/ChangeLog
libgfortran/io/file_pos.c

index cb4b0e39bb4ccf5ede7b5d6b94f368b761c7f77f..5022e9d252c6f33ce4edc1ca6a49168e09c4a3f7 100644 (file)
@@ -1,3 +1,9 @@
+2006-07-30  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libgfortran/28335
+       * file_position.c (st_flush): Add clearer error when UNIT does not
+       exist. Add reference to standard in comment.
+
 2006-07-30  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
 
        PR libgfortran/28335
index c306d6e8d73ef03631921bf325f902c25d0ad2ea..05bb42dc804eb463367124b8d46d898ef8e0d183 100644 (file)
@@ -340,7 +340,10 @@ st_flush (st_parameter_filepos *fpp)
       flush (u->s);
       unlock_unit (u);
     }
+  else
+    /* FLUSH on unconnected unit is illegal: F95 std., 9.3.5. */ 
+    generate_error (&fpp->common, ERROR_BAD_OPTION,
+                       "Specified UNIT in FLUSH is not connected");
 
-  /* CLOSE on unconnected unit is legal and a no-op: F95 std., 9.3.5. */ 
   library_end ();
 }