This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: Is a tab one or 7 chars when it comes to fitting on a punch card ?
- From: Tobias Schlüter <Tobias dot Schlueter at physik dot uni-muenchen dot de>
- To: Tobias Burnus <burnus at net-b dot de>
- Cc: Bud Davis <bdavis9659 at sbcglobal dot net>, fortran at gcc dot gnu dot org
- Date: Wed, 23 Jan 2008 14:41:17 +0100
- Subject: Re: Is a tab one or 7 chars when it comes to fitting on a punch card ?
- References: <103447.10205.qm@web81206.mail.mud.yahoo.com> <4797412B.90004@net-b.de>
Tobias Burnus wrote:
Bud Davis wrote:
fixed format source code. cat -T l.f
!234567890123456789012345678901234567890123456789012345678901234567890123456789
! 1 2 3 4 5 6 7
^I INTEGER A
this is deceptive, because cat displayed the tab as a ^I, so the text
is shown shifted right one
position.
g77 accepted this. gfortran does not
[...]
is this a bug ?
That is a question of view point. The Fortran 77 standard does not
define tabs but only has spaces. With spaces there is no problem. I
played around with some compilers and they all hand it differently
(including whether the line is cut off after 72 characters or not). If
you do not rely on the cut off, you can use -ffixed-line-length-none (or
-ffixed-line-length-n with your choice of "n").
As the standard does not mandate a particular choice and the different
compilers handle it differently, I would have the current solution;
however, if you can give compelling reasons for another choice, we can
change it.
Steve and I had a discussion on the interpretation of tabs back when he
added code to reject them in standard conforming code. You may want to
review it, the relevant subthread starts here
<http://gcc.gnu.org/ml/gcc-patches/2005-03/msg01221.html>. I remember
becoming confused somewhere in the thread so some of my posts may be
rightfully considered noise :-)
3 baby bugs ( no XOR operator, no common block name in VOLATILE
statements, tab counts more than one position in fixed format).
The problem with .XOR. (see PR 33432 and 34933) is that it potentially
conflicts with a user-defined .XOR. operator, which would reject valid
Fortran 95 code; as written one could implement it using a flag, but as
replacing it by .eqv. is presumably easier and makes the program more
^^^^^ .neqv.
standard conform.
Cheers,
- Tobi