Bogus "error: unterminated comment"
Tobias Burnus
burnus@net-b.de
Fri Feb 8 18:24:00 GMT 2008
FX wrote:
>> It may be salient that RFLCT.FOR has DOS line endings while unterm_comment.for does not.
>>
> No, it's not that. The problem is that RFLCT.FOR has a uppercase .FOR
> extension, which indicates to gfortran that C-style preprocessing is
> required, while it is not performed for a file having lowercase .for
> extension.
Regarding preprocessing and file extensions, see also:
http://gcc.gnu.org/onlinedocs/gfortran/Preprocessing-and-conditional-compilation.html
> C-style preprocessing, being C-style, doesn't deal well
> with /* and */. Some compilers deal with it (intel, sun), some don't
> (g95, gfortran)
The problem is that the preprocessor CPP has no Fortran mode. In a
Fortran mode, Comment lines / trailing comments would be completely
ignored and // not regarded as comment sign. See also bugreport PR 28662.
Tobias
More information about the Fortran
mailing list