On Tue, 12 Apr 2005, Patrick Wallace wrote:
> On Tue, 12 Apr 2005, Peter W. Draper wrote:
>
> > In this case the SST program PROLAT is printing '\\' as '\\', rather than
> > the usual single '\', as it must have done in the past (this would have
> > broken a lot of other code too). Anyone recall any recent Tru64 issues
> > with handling backslashes in Fortran? I'm guessing this came along with
> > the upgrade to f90.
>
> Backslash is not in the Fortran character set. I suspect the ANSI
> Standard is coy about what is supposed to happen, but the most consistent
> behaviour would be to treat it like any other printable non-Fortran
> character, '~' for example. So I would expect '\\' to be printed as
> two backslashes.
Hi Patrick,
yes, you're right of course, and the VMS behaviour was just as you
describe, but this is one of those areas where we see the joins between
UNIX and Fortran exposed and most UNIX Fortran compilers actually expect
to have backslash escaped by a backslash if you want to print a backslash
(and that's what most of our code assumes).
> It's just the sort of thing there's be a compiler flag for.
Yes, the Tru64 compiler has "-assume [no]backslash", unfortunately the man
page says that "-assume nobackslash" should be the default for the "f77"
command, but that's no longer true, and is what is causing the problem.
Norman,
I guess we should test compilers for this behaviour and parameterise it.
Worryingly what I describe to Patrick may not be the whole truth as a
quick scan of the old-style mk scripts reveals that CCDPACK used to set
"-assume backslash", which is exceedingly odd, as that's the reverse of
what I'd expect. A quick test shows that it is also currently broken, so
we may be able to do "FCFLAGS=-assume nobackslash" for now. I'll set a
job away and go home...
Peter.
|