Commit 5609699a by Jerry DeLisle

re PR fortran/46010 (I/O: Namelist-reading bug)

2010-10-26  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/46010
	* io/list_read.c (nml_parse_qualifier): Add additional conditions for
	setting the end index for loop specification. Fix some whitespace.
	* io/write.c (write_default_char4): Const-ify the source argument.

From-SVN: r165979
parent 892ae21c
2010-10-26 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/46010
* io/list_read.c (nml_parse_qualifier): Add additional conditions for
setting the end index for loop specification. Fix some whitespace.
* io/write.c (write_default_char4): Const-ify the source argument.
2010-10-21 Thomas Koenig <tkoenig@gcc.gnu.org> 2010-10-21 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/46007 PR fortran/46007
......
...@@ -2105,8 +2105,10 @@ nml_parse_qualifier (st_parameter_dt *dtp, descriptor_dimension *ad, ...@@ -2105,8 +2105,10 @@ nml_parse_qualifier (st_parameter_dt *dtp, descriptor_dimension *ad,
/* If -std=f95/2003 or an array section is specified, /* If -std=f95/2003 or an array section is specified,
do not allow excess data to be processed. */ do not allow excess data to be processed. */
if (is_array_section == 1 if (is_array_section == 1
|| !(compile_options.allow_std & GFC_STD_GNU)) || !(compile_options.allow_std & GFC_STD_GNU)
|| !dtp->u.p.ionml->touched
|| dtp->u.p.ionml->type == BT_DERIVED)
ls[dim].end = ls[dim].start; ls[dim].end = ls[dim].start;
else else
dtp->u.p.expanded_read = 1; dtp->u.p.expanded_read = 1;
...@@ -2121,12 +2123,12 @@ nml_parse_qualifier (st_parameter_dt *dtp, descriptor_dimension *ad, ...@@ -2121,12 +2123,12 @@ nml_parse_qualifier (st_parameter_dt *dtp, descriptor_dimension *ad,
} }
if (is_array_section == 1 && dtp->u.p.expanded_read == 1) if (is_array_section == 1 && dtp->u.p.expanded_read == 1)
{ {
int i; int i;
dtp->u.p.expanded_read = 0; dtp->u.p.expanded_read = 0;
for (i = 0; i < dim; i++) for (i = 0; i < dim; i++)
ls[i].end = ls[i].start; ls[i].end = ls[i].start;
} }
/* Check the values of the triplet indices. */ /* Check the values of the triplet indices. */
if ((ls[dim].start > (ssize_t) GFC_DIMENSION_UBOUND(ad[dim])) if ((ls[dim].start > (ssize_t) GFC_DIMENSION_UBOUND(ad[dim]))
......
...@@ -65,7 +65,7 @@ memcpy4 (gfc_char4_t *dest, const char *source, int k) ...@@ -65,7 +65,7 @@ memcpy4 (gfc_char4_t *dest, const char *source, int k)
/* Write out default char4. */ /* Write out default char4. */
static void static void
write_default_char4 (st_parameter_dt *dtp, gfc_char4_t *source, write_default_char4 (st_parameter_dt *dtp, const gfc_char4_t *source,
int src_len, int w_len) int src_len, int w_len)
{ {
char *p; char *p;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment