[patch, libgfortran] PR61640 KIND=4 Character Array Internal Unit Read Fail

Jerry DeLisle jvdelisle@charter.net
Sat Jun 28 23:13:00 GMT 2014


The attached patch is obvious and simple.  I will commit to trunk soon.

There are two things obvious about this.

1) Using the wrong function for wide characters.

2) No one must be using this feature of Fortran since the bug exists at least
back to 4.5

;)

Regression tested on x86-64-linux-gnu.

Test case attached. I would suggest since it is a wrong code bug, we should at
least port to 4.9.1.  I will wait a while before doing that and won't if anyone
feels strongly about not doing so. A portion of the patch in eat_spaces is a
correction to the fix for PR61499 for KIND=4.

Regards,

Jerry

2014-06-28  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/61640
	* io/list_read.c (next_char_internal): Adjust the read length to
	a single wide character. (eat_spaces): Add missing paren.
	* io/unix.c (mem_read4): Use the correct mem_alloc function for
	wide character internal reads.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr61640.diff
Type: text/x-patch
Size: 1240 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20140628/ffd84799/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: arrayio_16.f90
Type: text/x-fortran
Size: 461 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20140628/ffd84799/attachment-0001.bin>


More information about the Fortran mailing list