------- Comment #14 from burnus at gcc dot gnu dot org  2009-04-08 17:26 -------
(In reply to comment #12)
> +++ invoke.texi (working copy)
> -Allow @samp{$} as a valid character in a symbol name.
> +Allow @samp{$} as a valid non-first character in a symbol name. Symbols
> +that start with @samp{$} are rejected since it is unclear which rules to
> +apply to implicit typing as different vendors implement different rules.

Daniel, that patch is pre-approved and OK for the trunk.

  * * *

(In reply to comment #9)
> FORTRAN 77 standard clearly says that

Well, that does not count - the Fortran standards (66 to 2008) all say that $
is not allowed.

(In reply to comment #8)
> >I think the primary point of a compiler is to be standard compliant.
> 
> That's correct, but Fortran is probably an exception. It is not widely
> used nowadays, and there are two reasons to keep it: there is a lot of legacy
> code and there are people who do not want to learn modern languages.

In (theoretical) physics there is a huge amount of code Fortran code around
which is based on Fortran 90 and continues to be developed. I don't know how
much percentage is old code or completely new code, but I know projects which
started from scratch. And I wouldn't call Fortran 90 and less so Fortran 2003
and 2008 an old language.  Note: With vendors I meant Fortran compiler vendors.


> >I think gfortran does fairly well in this regard compared with other 
> >compilers, except of DEC structures all major extensions should be there.
> You can see a survey at http://www.polyhedron.com/pb05-win32-language0html
> and find out that gfortran and g95 are somewhere in the middle, neither
> best nor worst.

Well, it does not show all extensions - and there are some which gfortran has
and ifort doesn't. The goal is also not to have all extensions but only to have
the most important ones. The VAX structures mentioned there are also rather
hard to implement as they partially clash with Fortran 90's user-defined
operators. (It took Intel several years to get rid of all the bugs.)

> >It would help if you could make a survey (e.g. based on the
> >documentation) and see how the few other compilers, which support it, are
> >handling that. (I think IBM does, the xlf90 documentation could be a starting
> >point.)
> 
> I already know that the following compilers do support $ as the first symbol:
> 
> Intel Fortran 9.1
> Open Watcom Fortran 1.8
> MS Fortran for DOS 5.1

Well, the following compilers do not support it as first character but allow it
in the middle of a symbol:

- g95
- NAG f95
- SUN Studio sunf95
- Open64 openf95
(and presumably: Pathscale as it seems to be based on Open64, which is in turn
based on SGI if I remember correctly)

> Open Watcom Fortran implicit type for $ is REAL.
Ditto for IBM xlf90, however, as Dominique pointed out ifort treats it as
INTEGER.

The other question is whether "IMPLICIT INTEGER($-A)" is allowed or "IMPLICIT
INTEGER(A-$)" (i.e. implicit statement and when does $ come in the sequence).

> Speaking on $ as a legal symbol I can only add that this extension is already
> supported by gfortran, but in the way that is different from all other
> implementors.

No, that's not true - see above.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39670

Reply via email to