https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83191

--- Comment #5 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> ---
(In reply to Jerry DeLisle from comment #4)
> Alternatively one could do this:
> 
> @@ -1809,9 +1809,11 @@ write_complex (st_parameter_dt *dtp, const char
> *source, int kind, size_t size)
>                             precision, buf_size, result1, &res_len1);
>    get_float_string (dtp, &f, source + size / 2 , kind, 0, buffer,
>                             precision, buf_size, result2, &res_len2);
> -  lblanks = width - res_len1 - res_len2 - 3;
> -
> -  write_x (dtp, lblanks, lblanks);
> +  if (!dtp->u.p.namelist_mode)
> +    {
> +      lblanks = width - res_len1 - res_len2 - 3;
> +      write_x (dtp, lblanks, lblanks);
> +    }
>    write_char (dtp, '(');
>    write_float_string (dtp, result1, res_len1);
>    write_char (dtp, semi_comma);

With the following tweak:

@@ -1950,6 +1952,7 @@ list_formatted_write (st_parameter_dt *dtp, bt type, void
*p, int kind,
                  size * GFC_SIZE_OF_CHAR_KIND(kind) : size;

   tmp = (char *) p;
+  dtp->u.p.namelist_mode = 0;

   /* Big loop over all the elements.  */
   for (elem = 0; elem < nelems; elem++)
@@ -2394,6 +2397,7 @@ namelist_write (st_parameter_dt *dtp)
   char c;
   char *dummy_name = NULL;

+  dtp->u.p.namelist_mode = 1;
   /* Set the delimiter for namelist output.  */
   switch (dtp->u.p.current_unit->delim_status)
     {

Reply via email to