[RFC][PATCH] -d_lines

Bernhard Fischer rep.nop@aon.at
Wed Aug 17 09:50:00 GMT 2005


On Tue, Aug 16, 2005 at 10:14:40PM -0700, Steve Kargl wrote:
>On Wed, Aug 17, 2005 at 01:21:45AM +0200, Bernhard Fischer wrote:
>> 
>> Several "ancient" fortran programs do exercise -- as well as most
>> commercial compilers do support -- a variant of fixed-mode where 'D'
>> resp. 'd' in the first column of source is either treated as comment --
>> per default -- or as code -- if the compiler sees an argument akin to
>> -d_lines.
>> 
>> gfortran is, ATM, not able to deal with those, however.

>> PS: Changelog inlined in the patchlet; is this ok or should it be kept
>> in the accompagning mail body?
>
>ChangeLog should be in the accompanying email.

ok.
>
>As to my comments.
>
>(1) -d_lines is not expressed in the GNU standard for options.
>    It should be -fd_lines.

Fine with me either way.
>
>(2) I've never seen this convention in the 20 years that I've
>    been reading and writing Fortran code.  It looks like a

http://www.llnl.gov/icc/lc/asci/fpe/fpe.source.html#Comment%20lines
has an incomplete list of compilers which support those debug lines.
pathf95 has -d-lines
ifort has -d_lines
nagware seems to accept also 'd' and 'D' as comments
etc.

>    cute trick to avoid the use of a preprocessor (cpp, fpp,
>    or sed).   IMHO, this type of option does not belong in
>    gfortran, but I guess I'll accept it if the majority of
>    users want it.

e.g. gar2ped and Columbus use 'd', to name just two.

>>      case OPT_fdefault_double_8:

>> +    case OPT_d_lines:

>This should be placed in lexicographic order.

ok.

>> +      if (c == 'D' || c == 'd')
>> +	{
>> +	  if  (!gfc_option.d_lines)
>> +	    {
>> +	      /* d_lines is not set, line is a comment.  */
>> +	      skip_comment_line ();
>> +	      continue;
>> +	    }
>> +	  else

this else is superfluous, I'll remove it.

>> +	    /* d_lines is set, treat line as code and eat the identifier.  */
>> +	    *start.nextc++;
>> +	}
>
>I agree with Brook that this might screw up the locus for
>error reporting.  Have you read over the code that expands
>a tab in column 1 to 6 spaces.

Not yet. I wanted to know if supporting -fd_lines would be accepted in
principle.

I do not know if/how 'D' is supposed to influence the column count, but
I'd assume that the 'D' replaces the first space. ok?

thank you,
Bernhard



More information about the Fortran mailing list