[Bug fortran/66058] Backslash in comment kills compile

matthew.thompson at nasa dot gov gcc-bugzilla@gcc.gnu.org
Fri May 8 12:31:00 GMT 2015


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66058

--- Comment #3 from Matt Thompson <matthew.thompson at nasa dot gov> ---
(In reply to kargl from comment #2)
> (In reply to Matt Thompson from comment #1)
> > Addendum,
> > 
> > I've tried various gfortran flags, but for the life of me, none seem to get
> > this to work.
> > 
> > Matt
> 
> You're getting the expected behaviour implied by the .F extention.
> The pre-processor is doing what it is should (from n1256.pdf)
> 
>     Each instance of a backslash character (\) immediately followed
>     by a new-line character is deleted, splicing physical source
>     lines to form logical source lines.  Only the last backslash on
>     any physical source line shall be eligible for being part of
>     such a splice. A source file that is not empty shall end in a
>     new-line character, which shall not be immediately preceded
>     by a backslash character before any such splicing takes place.
> 
> The option that you are looking for is -xf95.  It tells gfortran
> to ignore the .F extension and treat the code as Fortran 95 without
> doing the pre-processing.

Ahh. Okay, thanks. It might be nice to put a reference to -x in the gfortran
manpage. It always confuses me that some Fortran options are only visible in
the gcc manpage...



More information about the Gcc-bugs mailing list