This is the mail archive of the
mailing list for the GCC project.
Re: [patch, libfortran] PR34427 namelist input of inf-nan
- From: Jerry DeLisle <jvdelisle at verizon dot net>
- To: Tobias Burnus <burnus at net-b dot de>
- Cc: Fortran List <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 16 Dec 2007 07:38:31 -0800
- Subject: Re: [patch, libfortran] PR34427 namelist input of inf-nan
- References: <476497EE.email@example.com> <4765238F.firstname.lastname@example.org>
Tobias Burnus wrote:
Jerry DeLisle wrote:
2007-12-15 Jerry DeLisle <email@example.com>The patch is OK, but I have some comments/questions:
* io/list_read.c (read_real): Handle intervening line ends and
(get_name): Don't push separators to saved_string.
(eat_separator): If in namelist mode eat spaces and line ends as
@@ -316,6 +316,13 @@ eat_separator (st_parameter_dt *dtp)
dtp->u.p.at_eol = 1;
+ if (dtp->u.p.namelist_mode)
+ c = next_char (dtp);
+ while (c == '\n' || c == '\r' || c == ' ');
+ unget_char (dtp, c);
I wonder whether one should do something similar for '\r'. If I recall
correctly, the normal line-break character on MacOS was (is?) '\r'
(while Unix has '\n' and Windows "\r\n").
According to Wikipedia, the '\r' is used in MacOS up to version 9. So we better
accommodate it just in case.
Additionally, I think one can replace:
if (!isdigit (c))
if (c == 'i' || c == 'I' || c == 'n' || c == 'N')
Done. I forgot this was in two places.
if (!isdigit (c))
I changed this in my original Inf/NaN patch to the upper version, but
you correctly remarked that it does not make much sense to have it for
exp2. (But I forgot to change it back when I checked the patch in.) You
can undo my change if you want.
Thanks for review. I will commit after the above changes and retest.