Bug 27652 - Array output does not self wrap
Summary: Array output does not self wrap
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: libfortran (show other bugs)
Version: 4.2.0
: P3 enhancement
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-18 00:59 UTC by H.J. Lu
Modified: 2006-05-18 05:16 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2006-05-18 00:59:41 UTC
[hjl@gnu-19 tmp]$ cat x.f90
program foo
 integer, dimension (1:20):: a
 a= 0
 print *,a
end
[hjl@gnu-19 tmp]$ /usr/gcc-4.2/bin/gfortran -static x.f90
[hjl@gnu-19 tmp]$ ./a.out
           0           0           0           0           0           0    0           0           0           0           0           0           0        0           0           0           0           0           0           0
[hjl@gnu-19 tmp]$ /opt/intel/fc/9.0/bin/ifort x.f90
[hjl@gnu-19 tmp]$ ./a.out
           0           0           0           0           0           0
           0           0           0           0           0           0
           0           0           0           0           0           0
           0           0
[hjl@gnu-19 tmp]$
Comment 1 Andrew Pinski 2006-05-18 01:09:51 UTC
I don't see that much problem with it.
It just is not wrapped (the wrapping you are seeing is wrapping done by your termainal and not gfortran/libgfortran).
Comment 2 Jerry DeLisle 2006-05-18 03:49:58 UTC
[jerry@quantum pr27652]$ ./a.out
0           0           0           0           0
0           0           0           0           0
0           0           0           0           0
0           0           0           0           0

By adjusting my terminal width I can get any number of alignments.  This is not a bug or even an enhancement.  This is why there are format statements.
Comment 3 H.J. Lu 2006-05-18 04:56:26 UTC
The testcase only have 20 elements of 0. The real array has more than
800 elements of complex with different values. I am debugging a gfortran
bug. Since gdb isn't really useful, I am using "print *," to see what
are in the array. Gfortran outputs a very long line. It is very hard to
exam/compare what are in the array. It will be nice for "print *" to
break the line if the line is over 80 chars.
Comment 4 Andrew Pinski 2006-05-18 04:59:02 UTC
redirect the output to a file and then read the file with a real editor.
Comment 5 Jerry DeLisle 2006-05-18 05:10:51 UTC
also do something like this:

print "(5(f10))", a

you will get a new line after every 5 values printed.  
Comment 6 Jerry DeLisle 2006-05-18 05:16:27 UTC
Oops, I forgot the period.  You need to match the width and precsion you want printed. For complex maybe you want to use 6 or 8 instead of the 5 for repeat count. 

print "(5(f10.4))", a