[Patch, libgfortran] [4.6/4.7/4.8/4.9 Regression] Namelist read fails with designators containing embedded spaces

Jerry DeLisle jvdelisle@charter.net
Sun Mar 31 03:53:00 GMT 2013


Hi all,

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?

Regards,

Jerry

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.
	



-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr56786.diff
Type: text/x-patch
Size: 3831 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20130331/49bb81b6/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: namelist_81.f90
Type: text/x-fortran
Size: 833 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20130331/49bb81b6/attachment-0001.bin>


More information about the Fortran mailing list