[Bug libfortran/48852] Invalid spaces in list-directed output of complex constants

jvdelisle at frontier dot com gcc-bugzilla@gcc.gnu.org
Thu May 5 12:30:00 GMT 2011


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48852

--- Comment #6 from jvdelisle at frontier dot com 2011-05-05 12:28:01 UTC ---
On 05/05/2011 12:04 AM, thenlich at users dot sourceforge.net wrote:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48852
---snip---
> As much as I'd like to, I cannot agree:
>
> "The only embedded blanks permitted within a complex constant are between the
> separator and the end of a record and one blank at the beginning of the next
> record."

I am a little concerned.  The above says 'constant'.  Does this mean a complex 
'variable' is output differently? Right now, the runtime libarary has no way to 
know the difference. We do have a control bit we can set before and after the 
transfer and we could have the frontend insert this for a complex constant.  It 
just seems odd that one would treat a constant differently from a variable so I 
am seeking clarity here.

Also, See below.  Does this give the expected output?

print *, (1.0, 0.0)
end

$ ./a.out
  (1.00000000,.00000000)

Index: write.c
===================================================================
--- write.c    (revision 173411)
+++ write.c    (working copy)
@@ -1509,15 +1509,15 @@
  {
    char semi_comma =
      dtp->u.p.current_unit->decimal_status == DECIMAL_POINT ? ',' : ';';
-
    if (write_char (dtp, '('))
      return;
+  dtp->u.p.g0_no_blanks = 1;
    write_real (dtp, source, kind);

    if (write_char (dtp, semi_comma))
      return;
    write_real (dtp, source + size / 2, kind);
-
+  dtp->u.p.g0_no_blanks = 0;
    write_char (dtp, ')');
  }



More information about the Gcc-bugs mailing list