[patch, libfortran] PR33253 namelist: reading back a string with apostrophe
Jerry DeLisle
jvdelisle@verizon.net
Mon Oct 1 05:12:00 GMT 2007
:ADDPATCH fortran:
Hi all,
After a lot of fussing, I think I have sorted this out.
The attached patch includes my original fix to this pr which checked for
delimiters to decide whether to terminate reading.
In addition, this patch adjusts the conditions that allow extended reads of
namelists. This now requires -std=legacy. The reason is that all these cases
with non standard namelists such as extra data or no delimiters end up
conflicting. The mechanism for handling these is present, its a matter of
choice when to allow what.
With this patch, non-delimited (no ' or ") strings work by default. The test
case namelist_24.f90 is modified to -std=legacy. Two new test cases are
provided. The test case namelist_39.f90 is derived from Toon Moene's case in
pr33421.
I want to mention that according to the F95 standard, character strings in
namelists are supposed to be delimited. People should do that. (strong hint to
anyone reading this :) ).
Regression tested on x86-64.
OK for trunk?
Regards,
Jerry
2007-09-30 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libfortran/33252
* io/list_read.c (read_character): Use DELIM_APOSTROPHE and DELIM_QUOTE
in check of first character in string.
(nml_parse_qualifier): Only allow extended reads if -std=legacy
is given.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr33253.diff
Type: text/x-patch
Size: 1066 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20071001/6b109fe4/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: namelist_38.f90
Type: text/x-fortran
Size: 778 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20071001/6b109fe4/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: namelist_39.f90
Type: text/x-fortran
Size: 705 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20071001/6b109fe4/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: namelist_24.f90
Type: text/x-fortran
Size: 1748 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20071001/6b109fe4/attachment-0003.bin>
More information about the Fortran
mailing list