[Bug fortran/39670] New: dollar sign in entities is not recognized when it is first symbol

2009-04-07 Thread anickol at yahoo dot com
With option -fdollar-ok the compiler does not recognize symbols that start with
$

test case:

program test
a$a = 12
$a = 12! error
end

I currently have a lot of legacy code with identifiers starting with $.


-- 
   Summary: dollar sign in entities is not recognized when it is
first symbol
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: minor
  Priority: P3
 Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: anickol at yahoo dot com


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



[Bug fortran/39670] dollar sign in entities is not recognized when it is first symbol

2009-04-07 Thread anickol at yahoo dot com


--- Comment #2 from anickol at yahoo dot com  2009-04-07 08:59 ---
As I already said, I have code, being compiled with MS Fortran, that has
a lot of variable names starting with $. MS Fortran allows it.

My personal opinion is that the Fortran compiler's primary use is support
of the legacy code. That means that the implementation of any extension 
or even strange behaviour of existing compilers could be useful and will
save hours of hard work. Forcing standards on existing code is illogical.


-- 


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



[Bug fortran/39670] dollar sign in entities is not recognized when it is first symbol

2009-04-08 Thread anickol at yahoo dot com


--- Comment #8 from anickol at yahoo dot com  2009-04-08 07:12 ---
>One of the questions which immediately come up, 
>which data type is $foo (implicit typing)

One interpretation of implicit typing of Fortran is:
I-N are integers, everything else is real.

>I think the issue had come up before and the PRs were closed as wont-fix.

Sorry, but I could not find it. I searched the database before posting.

>I think the primary point of a compiler is to be standard compliant.
>My impression is that nowadays all compiler vendors and most of the compiler
customers think likewise.

That's correct, but Fortran (and possibly also Cobol and Algol, if anybody
cares about Algol, which I doubt) 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.

>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. The leader is Intel Fortran. It is also makes the fastest
code according to the same source.

>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

Open Watcom Fortran implicit type for $ is REAL.

(arrogant comments in the style "go learn SED" are ignored)

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. Clearly it is impossible to implement all possible extensions
from all vendors ever existed, but probably there is a reason to make already
implemented extension compatible with others.


-- 


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



[Bug fortran/39670] dollar sign in entities is not recognized when it is first symbol

2009-04-08 Thread anickol at yahoo dot com


--- Comment #9 from anickol at yahoo dot com  2009-04-08 07:39 ---
Update regarding implicit rules:

FORTRAN 77 standard clearly says that:
"A first letter of I, J, K, L, M, or N implies type integer and ANY OTHER
letter implies type real"

FORTRAN 66 standard has similar statement.

This means the following: if -fdollar-ok extension accepts currency sign as a
valid LETTER in a symbolic name, then it should be treated as REAL according to
the standard. There is only one argument against it, if -fdollar-ok extension
accepts currency sign as a DIGIT. Is it ?


-- 


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