Dear Aleks:
Aleksandar Donev wrote:
> Hello,
>
> I am trying to compile FLIB with a new compiler and am getting a weird
> error for the harmless line:
>
> CALL CHR_SAR("\","/", buf)
> ^
> Warning : \ used as an escape character is an extension to standard
> Fortran 95
> ^
> Error : incomplete string
> ....
>
> I don't even know what \ is used for in these extensions (and the
> compiler should have figured out that this is part of a string!!!), but
> I am assuming it means end of line.
>
> I am *not* using any special compilation switches.
>
> Any ideas what I can do?
> Thanks,
> Aleksandar
This is a C-ism that has found its way into a large number of Fortran compilers,
especially in Unix-ish environments. This extension allows the use of C language
escape sequences (e.g., "\n", "\a", etc.) directly in Fortran code, instead of
requiring the programmer to use some other construct.
You need to read the compiler documentation in order to find out how to turn
this off.
I am very surprised that the compielr has this on by default. Indeed, having
this "feature" on by default could be considered non-standard-conforming, since it
changes the interpretation of what is otherwise standard-conforming code. If it is
on by default, you should complain LOUDLY to the vendor.
--
----------
Sincerely,
Craig T. Dedo
17130 W. Burleigh Place Internet: [log in to unmask]
Brookfield, WI 53005-2759 Voice Phone: (262) 783-5869
USA Fax Phone: (262) 783-5928
"They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety." -- Benjamin Franklin
(1759)
|