Message ID | 5C6DD5DB.3030501@gmx.de |
---|---|
State | New |
Headers | show |
Series | [PR,fortran/83057] - OPEN without a filename and without STATUS='SCRATCH' could produce a warning | expand |
On 2/20/19 2:34 PM, Harald Anlauf wrote: > There was a rather obvious bug in the logic for checking the arguments > to the OPEN statement when NEWUNIT= was specified, which prohibited > the generation of the appropriate error message. > > Regtested successfully. > > OK for trunk? Yes and thanks for patch. Jerry
Committed to trunk as rev. 269134. Thanks for the review! Harald On 02/22/19 06:28, Jerry DeLisle wrote: > On 2/20/19 2:34 PM, Harald Anlauf wrote: >> There was a rather obvious bug in the logic for checking the arguments >> to the OPEN statement when NEWUNIT= was specified, which prohibited >> the generation of the appropriate error message. >> >> Regtested successfully. >> >> OK for trunk? > > Yes and thanks for patch. > > Jerry >
Index: gcc/fortran/io.c =================================================================== --- gcc/fortran/io.c (revision 269028) +++ gcc/fortran/io.c (working copy) @@ -2504,16 +2504,15 @@ goto cleanup; } - if (!open->file && open->status) - { - if (open->status->expr_type == EXPR_CONSTANT + if (!open->file && + (!open->status || + (open->status->expr_type == EXPR_CONSTANT && gfc_wide_strncasecmp (open->status->value.character.string, - "scratch", 7) != 0) - { + "scratch", 7) != 0))) + { gfc_error ("NEWUNIT specifier must have FILE= " "or STATUS='scratch' at %C"); goto cleanup; - } } } else if (!open->unit)