------- Comment #5 from kargl at gcc dot gnu dot org  2010-02-16 16:01 -------
(In reply to comment #4)
> Subject: Re:  gfortran: spurious warning of line truncation
>  at col 72
> 
> On Tue, 16 Feb 2010, patrick dot wallace at stfc dot ac dot uk wrote:
> 
> > Mystery solved.  It is to do with line endings.  When gfortran sees
> > a file with DOS line endings it interprets the CR and LF as separate
> > characters.  This is why demonstrating the effect is so slippery.
> > 
> > I guess gfortran is within its rights to work this way, and only
> > accept Unix line endings.  But I would argue that this is unhelpful,
> > and that it would be better to make gfortran detect the condition
> > and deal with it sympathetically.
> 
> I think all the front ends should behave like the C-family ones in this 
> regard, and accept all of CR, LF and CRLF as meaning end-of-line 
> regardless of the host OS.
> 

Well, it's a counting issue. Fixed-form Fortran is required to have
exactly 72 characters in a line of code.  Does CRLF count as one 
character or two?  gfortran currently counts CRLF as two characters,
which is the source of the problem and the reason why I could not
reproduce the problem. It might be possible to ignore CR in the 
gfortran parser.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43078

Reply via email to