2010-04-24 Jerry DeLisle <jvdelisle@gcc.gnu.org>
authorjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 24 Apr 2010 12:04:09 +0000 (12:04 +0000)
committerjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 24 Apr 2010 12:04:09 +0000 (12:04 +0000)
PR fortran/43832
* io.c (gfc_match_open): Remove branch to syntax error. Add call to
gfc_error with new error message.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158684 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/fortran/ChangeLog
gcc/fortran/io.c

index 6072c05..82d2fe3 100644 (file)
@@ -1,3 +1,9 @@
+2010-04-24  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR fortran/43832
+       * io.c (gfc_match_open): Remove branch to syntax error. Add call to
+       gfc_error with new error message.
+
 2010-04-24  Paul Thomas  <pault@gcc.gnu.org>
 
        PR fortran/43841
index 6766f3d..dc20bc2 100644 (file)
@@ -1771,8 +1771,6 @@ gfc_match_open (void)
   if (m == MATCH_NO)
     {
       m = gfc_match_expr (&open->unit);
-      if (m == MATCH_NO)
-       goto syntax;
       if (m == MATCH_ERROR)
        goto cleanup;
     }
@@ -1820,6 +1818,11 @@ gfc_match_open (void)
          goto cleanup;
        }
     }
+  else if (!open->unit)
+    {
+      gfc_error ("OPEN statement at %C must have UNIT or NEWUNIT specified");
+      goto cleanup;
+    }
 
   /* Checks on the ACCESS specifier.  */
   if (open->access && open->access->expr_type == EXPR_CONSTANT)