fno-backslash not available in gfortran
Brooks Moses
bmoses-nospam@cits1.stanford.edu
Thu Jun 23 22:59:00 GMT 2005
François-Xavier Coudert wrote:
[quoting Richard Maine, though the attribution got lost]
> > If the backslash is a graphic
> > character in the processor's character set (which it seems to be as far
> > as I can tell), then the standard specifies that it can be used in
> > literal character strings without any special provisions.
>
> But then, real-life fortran is a mix from the standard (a large dose)
> and things that people got so addicted to that not using it could be
> considered Evil. Two examples:
>
> 1. the standard does not say anything about a file named
> "/dev/null". Surely the fact that writing to it and rewinding doesn't
> enable us to read the data back is not standard-complying.
>
> 2. C-style preprocessing.
I think these are a different class of things, though. Although you say
"surely [/dev/null] is not standard-complying", on a quick check through
the "files" section of the F95 (draft) standard I don't see anything
that even comes close to guaranteeing the behavior of a file with
regards to what it contains after being written, and whether than
information can be read back. Thus, the expectation that a file can be
rewound and read back is no more a requirement of the standard than the
behavior /dev/null is.
Similarly, C-style preprocessing isn't addressed by the standard. A
file which requires preprocessing is not intended to be a
standard-conforming Fortran file; it is a file which can be used to
generate a standard-conforming Fortran file -- and so the standard only
speaks to what the file should be like _after_ preprocessing. The fact
that these are distinct is reflected in the fact that C-style
preprocessing is _not_ invoked unless one uses a different file
extension.
> So, I don't have a strong opinion on this particular problem
> (backslash interpretation), but I do see it a bit like the /dev/null
> issue. This is not standard conforming, but we all got so addicted to
> it...
The difference, though, is that your examples are not standard-violating
-- they are merely things that are not required by the standard.
Backslash interpretation does, however, directly violates the standard
(assuming Richard's argument is correct), and thus it _is_ a bug to have
it enabled by default with -std=F95 and the like.
- Brooks
--
The "bmoses-nospam" address is valid; no unmunging needed.
More information about the Fortran
mailing list