[patch, libgfortran] PR78351 comma not terminating READ of formatted input field

Jerry DeLisle jvdelisle@charter.net
Sat Nov 3 22:33:00 GMT 2018


Hi all,

The attached patch adds code in read_sf_internal to handle early 
termination of reads in the presence of comma's. This is to support 
legacy codes which are not standard conforming as far as we can tell.

The additions are executed only if -std=legacy is given at compile time. 
  It does not support kind=4 internal units since in legacy years there 
should be no kind=4 internal units.

I have provuded a simplified test case for various combinations of comma 
embedded strings.

This has been regression tested on x86_64-pc-linux-gnu.

OK for trunk?

This use to work way back in early versions so should probably go to 7 
and 8 branches. Opinions welcome.

Regards,

Jerry

2018-11-04  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	* io/transfer.c (read_sf_internal): Add support for early
	comma termination of internal unit formatted reads.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr78351a.diff
Type: text/x-patch
Size: 3691 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20181103/051002a8/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: read_legacy_comma.f90
Type: text/x-fortran
Size: 737 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20181103/051002a8/attachment-0001.bin>


More information about the Fortran mailing list