diff options
Diffstat (limited to 'gcc/fortran/io.c')
-rw-r--r-- | gcc/fortran/io.c | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/gcc/fortran/io.c b/gcc/fortran/io.c index 0aa31bb..8008f92 100644 --- a/gcc/fortran/io.c +++ b/gcc/fortran/io.c @@ -2150,33 +2150,6 @@ gfc_match_open (void) warn = (open->err || open->iostat) ? true : false; - /* Checks on NEWUNIT specifier. */ - if (open->newunit) - { - if (open->unit) - { - gfc_error ("UNIT specifier not allowed with NEWUNIT at %C"); - goto cleanup; - } - - if (!open->file && open->status) - { - if (open->status->expr_type == EXPR_CONSTANT - && gfc_wide_strncasecmp (open->status->value.character.string, - "scratch", 7) != 0) - { - gfc_error ("NEWUNIT specifier must have FILE= " - "or STATUS='scratch' at %C"); - 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) { @@ -2501,6 +2474,33 @@ gfc_match_open (void) } } + /* Checks on NEWUNIT specifier. */ + if (open->newunit) + { + if (open->unit) + { + gfc_error ("UNIT specifier not allowed with NEWUNIT at %C"); + goto cleanup; + } + + if (!open->file && open->status) + { + if (open->status->expr_type == EXPR_CONSTANT + && gfc_wide_strncasecmp (open->status->value.character.string, + "scratch", 7) != 0) + { + gfc_error ("NEWUNIT specifier must have FILE= " + "or STATUS='scratch' at %C"); + goto cleanup; + } + } + } + else if (!open->unit) + { + gfc_error ("OPEN statement at %C must have UNIT or NEWUNIT specified"); + goto cleanup; + } + /* Things that are not allowed for unformatted I/O. */ if (open->form && open->form->expr_type == EXPR_CONSTANT && (open->delim || open->decimal || open->encoding || open->round |