This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [gfortran] patch for pr 15413


On Sat, May 15, 2004 at 10:08:27PM +0100, Paul Brook wrote:
> On Thursday 13 May 2004 23:03, Janne Blomqvist wrote:
> > The Fortran standard specifies that list-directed output should begin
> > with a blank. This patch will make it so. Numbers already do this
> > correctly, so the patch only changes output of characters.
> 
> Numbers are not output correctly. For example:
> 
> program prog
>   print*, 123456789012_8
> end program

You're correct. I didn't consider long numbers like above. Also I
noticed that complex numbers suffer from the same problem, the "("
gets printed without a preceeding blank. Please consider the patch
below instead of my original patch. It is even simpler than the
original one by virtue of unconditionally printing a blank before
proceeding with the list i/o. This means that all numeric output is
shifted one character to the right, also those that previously were
compliant. But I wouldn't consider that a problem since the (draft
2003) standard only specifies that a "reasonable" value should be used
for the field width. And there is no mention nor implication as far as
I can tell that the width of the first field should be one less than
for the other fields to compensate for the initial blank.

=================================================================

diff -c3 -p write.c.orig write.c
*** write.c.orig        Thu May 13 23:09:02 2004
--- write.c     Sun May 16 15:50:23 2004
*************** write_char (char c)
*** 880,886 ****
  static void
  write_logical (const char *source, int length)
  {
-   write_char (' ');
    write_char (extract_int (source, length) ? 'T' : 'F');
  }
  
--- 880,885 ----
*************** list_formatted_write (bt type, void *p, 
*** 1039,1044 ****
--- 1038,1044 ----
      {
        g.first_item = 0;
        char_flag = 0;
+       write_char(' ');
      }
    else
      {

==================================================================

Again, with write.c.orig referring to tree-ssa 20040513, directory
being gcc/libgfortran/io.

> 
> 
> Do you have a copyright assignment for GCC? If not we will need one before we 
> can accept any more patches from you.

No, I thought that I'm so far well below the "legally significant"
level.

Is there anything else I have to do other than follow the instruction
e.g. on http://gcc.gnu.org/ml/gcc/2003-06/msg02298.html (fill in the
form and send it to assign@gnu.org, wait for papers to arrive by snail
mail)?


-- 
Janne Blomqvist


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]