[Patch, libgfortran] [4.6/4.7/4.8/4.9 Regression] Namelist read fails with designators containing embedded spaces
Tobias Burnus
burnus@net-b.de
Sun Mar 31 20:06:00 GMT 2013
Am 31.03.2013 05:53, schrieb Jerry DeLisle:
> The attached patch fixes this PR by removing a spurious call to next_char which
> threw off the parsing sequence. In addition, I audited the file for other tests
> of EOF and corrected the error handling. This eliminated some wrong error
> messages or undefined error messages when an EOF is encountered during a
> namelist read.
>
> Also needed to modify hit_eof to not set the file position status for namelist
> mode to AFTER_ENDFILE to assure we get the correct EOF error.
>
> Also attached is the original test case from the PR, modified to include some
> reads cut short by EOF.
>
> Regression tested on x86-64.
> OK for trunk?
OK thanks for the patch - with the clarification in the comment below
"err_ret:" (in the two functions), as discussed in IRC.
Tobias
> 2013-03-29 Jerry DeLisle<jvdelisle@gcc.gnu.org>
>
> PR libfortran/56786
> * io/list_read.c (nml_parse_qualifier): Remove spurious next_char call
> when checking for EOF. Use error return mechanism when EOF detected.
> Do not return false unless parse_err_msg and parse_err_msg_size have
> been set. Use hit_eof.
> (nml_get_obj_data): Likewise use the correct error mechanism.
> * io/transfer.c (hit_eof): Do not set AFTER_ENDFILE if in namelist
> mode.
More information about the Fortran
mailing list