[patch, libgfortran] PR69456 Namelist value with trailing sign is ignored without error
Jerry DeLisle
jvdelisle@charter.net
Mon Feb 22 21:45:00 GMT 2016
Hi all,
The problem here is we were treating a bad exponent as if it was a bad read. On
bad reads we take a soft error path and go back to see if we are reading a new
namelist name. It is done this way because short reads, for example, part of an
array, are permitted. To get to the code where the error occurs, we have to have
read an exponent sign or a valid number with an exponent letter. In this case it
is not likely that we are reading a namelist name.
So, the patch takes the hard error path for a bad exponent so that we get a real
error.
I also noticed the error messages were not giving the correct item number
(always zero) so I realized the item_count was not being incremented for each
object. So fixed this as well.
Regression tested on x86-64-Linux. One new test case and one modified.
OK for trunk? Not strictly a regression, but simple enough.
Jerry
2016-02-22 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/69456
* io/list_read.c (read_real): If digit is missing from exponent issue
an error. (parse_real): Likewise and adjusted error message to clarify
it is part of a complex number.
(nml_read_obj): Bump item count and add comment that this is used to
identify which item in a namelist read has a problem.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr69456.diff
Type: text/x-patch
Size: 3541 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20160222/cae71938/attachment.bin>
More information about the Fortran
mailing list