fno-backslash not available in gfortran

François-Xavier Coudert fxcoudert@gmail.com
Tue Jun 21 16:40:00 GMT 2005


> I have trouble with the concept of calling -fno-backslash an
> "extension".

Well, I do agree with your opinion here. Note that it is note called
an extension any more (but then, the Extension section of gfortran
should really be called a "To Do" section).

The main reason for the current behavior (having -fbackslash turned on
by default) is historical. g77 used to do it that way (and not too
many people complained about this). In fact, this whole option is a
bit strange, since it does only affect the behavior of parsing the
source code file.

Of course, we could consider turning this off when the compiler is
called with -std=f95 and/or -pedantic. I don't think it is a
particularly interesting feature, but it could be done.

> 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.

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...

Of course, not having the ability to turn it off was really a bug.

> And the thought
> that there isn't even an option to turn it off... Well, that would be a
> show-stopper for lots of codes. I hadn't gotten that far in porting my
> codes (stopped by other bugs that are in the bug database), but if I
> got that far, I doubt I'd try to work around undefeatable C backslash
> processing - I'd just say that the compiler wasn't yet suitable for use
> on my codes.

Well, there are two things I want to say here. First, now, *it is*
possible to turn it off. And second, if it wasn't possible before, it
just means that nobody ever requested it!

FX



More information about the Fortran mailing list