This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/31190] minimum field width list-directed output
- From: "jvdelisle at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Dec 2008 06:23:37 -0000
- Subject: [Bug fortran/31190] minimum field width list-directed output
- References: <bug-31190-9647@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from jvdelisle at gcc dot gnu dot org 2008-12-22 06:23 -------
I think that this PR could be considered resolved by the new g0 edit
descriptor.
If, for example, you have three items to emit, the following will do so
regardless of their type.
program minimal_output
integer :: a
real :: b
character(10) :: c
a = 7
b = 11.356
c = "some text"
print '(3(g0,1x))', a,b,c
! or
print '(g0,1x,g0,1x,g0)', a,trim(c),b
end program
With latest trunk, this gives:
$ ./a.out
7 11.356000 some text
7 some text 11.356000
$
So the formatting is simple with some control over spacing.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31190