[patch, libgfortran] PR47667 I/O for reals: READ waits for input after "i" and "n"
Jerry DeLisle
jvdelisle@frontier.com
Tue Feb 15 05:51:00 GMT 2011
On 02/12/2011 04:58 AM, Jerry DeLisle wrote:
> On 02/11/2011 11:27 PM, Janne Blomqvist wrote:
>> On Sat, Feb 12, 2011 at 01:48, Jerry DeLisle<jvdelisle@frontier.com> wrote:
>>> Hi,
>>>
>>> The attached patch was regression tested x86-64. This prevents calling
>>> eat_line and waiting for the next line.
>>>
>>> We don't really have a wat to do a test case.
>>>
>>> OK for trunk?
>>
>> Ok.
>>
>> As a curiosity, shouldn't eat_line() effectively be a no-op if the
>> current character is "\n"?
>>
>
> Yes, and a similar problem exists with logical and '.', integer and '+' and '-',
> and complex and '('.
>
> We could pass the current character into eat_line, but I would have to modify
> code everywhere it is used. Another option would be to put c inside the dtp
> structure, and then test it in eat_line. That is also quite intrusive.
>
> Since we have this same if block for all the different types I think i will just
> modify by using the same else if (c != '\n') in the specific places.
>
> I will resubmit the patch with those cases.
>
Here is an updated patch. Regression tested on x86-64. This patch adjusts
reading for all types to avoid unwanted waiting for input. The patch also gives
more flexible input for complex reads by permitting line feeds before and after
'(', ',', and ')' This appears to be a common convention for reading complex values.
OK for trunk?
Regards,
Jerry
2011-02-14 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/47567
* io/list_read.c (read_logical): Check for end of line before calling
eat_line. (read_integer): Likewise. (parse_real): Don't unget the
separator. Check for end of line before calling eat_line.
(read_complex): Allow line-end before and after parenthesis and comma.
Check for end of line before calling eat_line. (read_real): Check for
end of line before calling eat_line.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr47667-2.diff
Type: text/x-patch
Size: 2969 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20110215/da21f782/attachment.bin>
More information about the Fortran
mailing list