This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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: print * list-directed output spacing


On 06/29/2012 01:50 AM, David Edelsohn wrote:
Earlier FORTRAN compilers generated the minimum number of spaces
required to delimit the items in list-directed output.  For instance,
if the three integers 1, 2, 3 are printed out from the trivial program
   PRINT *, 1, 2, 3
   END
we see
  1 2 3
^ ^ ^  <--- These point to the blanks in the previous line
  However, in the Intel Fortran environment and in recent versions of
the GNU Fortran environment, a more simplistic algorithm is used,
which usually results in lots of blank space; for instance, in the
mode where integers are four-byte objects, the printout is like this
            1           2           3
^^^^^^^^^^^ ^^^^^^^^^^^ ^^^^^^^^^^^  <--- These point to the blanks in
the previous line
and where they are eight-byte objects, the printout is like this
                     1                    2                    3
^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^  <---
These point to the blanks in the previous line.

Intel provides a "-standard-semantics" command-line option to produce
the earlier behavior.  Is there any equivalent option for GNU Fortran?

Not yet. We have a PR for this one requesting the simpler single spacing. It is not difficult to do, but higher priorities have prevented me of late getting to it.


One philosophical point. It is very easy to create a format statement and just format the results. For some reason, many of us just want the compiler to do what we want it to do without us telling it to do that.

Cheers,

Jerry


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