convert 'C' code to 'Fortran'

M

Michael Wojcik

Hi,
Can anyone help me find a software that can convert a code in 'C'
to 'Fortran77/90' automatically?

I didn't even know there was a fractional Fortran standard. I've only
used the integral ones (well, sometimes their derivatives).
 
D

Dan Pop

I didn't even know there was a fractional Fortran standard. I've only
used the integral ones (well, sometimes their derivatives).

F77S was a fraction of the F77 standard (a "subset" in the F77 jargon).

Dan
 
K

Keith Thompson

It's not the main program you want to write in Ada, but the interface
between the C and the Fortran code. I.e. if the Fortran code needs to
call a C function, provide an Ada wrapper that is Fortran callable and
that knows how to call the C function. Then again, it is not clear how
portable the solution would be in the real world (see your own
parenthetical remark).

If the main program is written in a language other than Ada, it will
have to call a special routine "adainit" to initialize (elaborate) the
Ada runtime. (This was added in Ada 95; Ada 83 didn't have it (which
is probably why I incorrectly assumed the main program would need to
be in Ada).)
 
D

Dave Thompson

In <[email protected]> Keith Thompson <[email protected]> writes:

Not quite. It's similar to Pascal pointers: you can't perform pointer
arithmetic on them.
Not just Pascal; outside the C family, I don't know of any HLL that
has pointer arithmetic, except that I hear it has been added (I think
implementation-dependently) to PL/I more recently than the last time I
used it seriously. Ada's primary form of pointers, access types, are
opaque but it has standard syntax for conversion to and from 'address'
types that support some arithmetic.

F90 POINTERs are unusual -- AFAIK unique -- in that for arrays they
are full dope vectors that can designate noncontiguous slices.


- David.Thompson1 at worldnet.att.net
 
M

Michael Wojcik

Not just Pascal; outside the C family, I don't know of any HLL that
has pointer arithmetic, except that I hear it has been added (I think
implementation-dependently) to PL/I more recently than the last time I
used it seriously.

COBOL added pointer arithmetic (SET [pointer] UP [or DOWN] BY [amount])
in the 2002 standard, and some flavors (eg Micro Focus) have had it for
longer. (The oldest example I have for MF COBOL at hand is from 1997,
but I think pointer arithmetic was added significantly earlier than
that.)
 
R

Richard Bos

Not just Pascal; outside the C family, I don't know of any HLL that
has pointer arithmetic, except that I hear it has been added (I think
implementation-dependently) to PL/I more recently than the last time I
used it seriously.

COBOL added pointer arithmetic (SET [pointer] UP [or DOWN] BY [amount])

Ow! My eyes... will you please not do that? It hurts...

Richard
 
M

Michael Wojcik

COBOL added pointer arithmetic (SET [pointer] UP [or DOWN] BY [amount])

Ow! My eyes... will you please not do that? It hurts...

Not do which? Use block capitals (customary for posting COBOL,
though I use lowercase for actual COBOL source), use square brackets
(standard for editorial insertions in English), or post COBOL (I have
no excuse for that)?

I must admit reading COBOL often pains me too. On the other hand,
the comp.lang.cobol regulars will make the same complaint about C...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top