Is a tab one or 7 chars when it comes to fitting on a punch card ?

Tobias Schlüter Tobias.Schlueter@physik.uni-muenchen.de
Wed Jan 23 19:23:00 GMT 2008


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



More information about the Fortran mailing list