From: jvdelisle Date: Sat, 24 Apr 2010 12:04:09 +0000 (+0000) Subject: 2010-04-24 Jerry DeLisle X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bea8073c80dae26af669d7d1c71b9652bbfe12fc;p=thirdparty%2Fgcc.git 2010-04-24 Jerry DeLisle 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 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 6072c0562f28..82d2fe3591a1 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2010-04-24 Jerry DeLisle + + 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 PR fortran/43841 diff --git a/gcc/fortran/io.c b/gcc/fortran/io.c index 6766f3d8a23b..dc20bc2ffb60 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)