diff options
author | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2010-04-24 12:04:09 +0000 |
---|---|---|
committer | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2010-04-24 12:04:09 +0000 |
commit | 2b8f356c732d762c2723191a067870d9bb310ab9 (patch) | |
tree | 6ed71d7103ffdcb3b074969c31179be9334c55aa /gcc/fortran/io.c | |
parent | 991b4da12247eb3e688e47f393229cc098bc7cea (diff) | |
download | gcc-2b8f356c732d762c2723191a067870d9bb310ab9.zip gcc-2b8f356c732d762c2723191a067870d9bb310ab9.tar.gz gcc-2b8f356c732d762c2723191a067870d9bb310ab9.tar.bz2 |
re PR fortran/43832 (OPEN statement not diagnosing missing unit number)
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.
From-SVN: r158684
Diffstat (limited to 'gcc/fortran/io.c')
-rw-r--r-- | gcc/fortran/io.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/fortran/io.c b/gcc/fortran/io.c index 6766f3d..dc20bc2 100644 --- a/gcc/fortran/io.c +++ b/gcc/fortran/io.c @@ -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) |