[gfortran] PATCH Fix PR 18537

Tobias Schlüter tobias.schlueter@physik.uni-muenchen.de
Sat Mar 12 15:46:00 GMT 2005


Since the discussion on comp.lang.fortran seems to have come to an end, I
think we can try to figure out the right behavior WRT tabs.

In my opinion, the right thing would be this:
- if no additional options are given, we deal with tabs as-is.  I.e. accept
tabs everywhere and treat them as synonymous to blanks, except in the first
six columns of a fixed-form source file, where they skip to column 7, and in
character-literal-constants, where they're translated to something like ACHAR(9)
- if -Wall is used, we warn for tabs that are used outside of comments
- if -std=f95 is used we issue an error, if a tab is used in a place where a
blank is required, IOW we treat it as a graphic character.  Declaring it a
control character would be contrary to the principle of least surprise,
according to which I would expect the compiler to accept tabs in comments or
character-literal-constants.

I understand that this might require a bigger patch, but I think that making
tabs wrong everywhere is too big a tradeoff compared to the benefits of this
warning (which, IMO, are very small as I don't think there's any compiler
which doesn't accept tabs relatively freely)

If anybody has an opinion on these issues, please speak up.  If you think that
Steve's original patch is the right thing, please let us know, I'm certainly
not trying to prevent an enhancement.

- Tobi



More information about the Gcc-patches mailing list