Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Staff meeting in the conference room in %d minutes.


devel / comp.lang.fortran / f2c updated to handle Fortran structures

SubjectAuthor
* f2c updated to handle Fortran structuresLynn McGuire
+- Re: f2c updated to handle Fortran structuresgah4
+* Re: f2c updated to handle Fortran structuresRobin Vowels
|`* Re: f2c updated to handle Fortran structuresLynn McGuire
| `* Re: f2c updated to handle Fortran structuresRobin Vowels
|  `* Re: f2c updated to handle Fortran structuresLynn McGuire
|   +* Re: f2c updated to handle Fortran structuresDaniel Feenberg
|   |`* Re: f2c updated to handle Fortran structuresLynn McGuire
|   | `* Re: f2c updated to handle Fortran structuresThomas Koenig
|   |  +- Re: f2c updated to handle Fortran structuresgah4
|   |  `* Re: f2c updated to handle Fortran structuresLynn McGuire
|   |   `* Re: f2c updated to handle Fortran structuresRon Shepard
|   |    +* Re: f2c updated to handle Fortran structuresLynn McGuire
|   |    |`* Re: f2c updated to handle Fortran structuresgah4
|   |    | `* Re: f2c updated to handle Fortran structuresThomas Koenig
|   |    |  `* Re: f2c updated to handle Fortran structuresBeliavsky
|   |    |   +- Re: f2c updated to handle Fortran structuresgah4
|   |    |   +- Re: f2c updated to handle Fortran structuresRobin Vowels
|   |    |   +* Re: f2c updated to handle Fortran structuresFortranFan
|   |    |   |+* Re: f2c updated to handle Fortran structuresRon Shepard
|   |    |   ||+* Re: f2c updated to handle Fortran structuresFortranFan
|   |    |   |||`- Re: f2c updated to handle Fortran structuresRon Shepard
|   |    |   ||`* Re: f2c updated to handle Fortran structuresgah4
|   |    |   || `* Re: f2c updated to handle Fortran structuresRon Shepard
|   |    |   ||  `* Re: f2c updated to handle Fortran structuresgah4
|   |    |   ||   `* Re: f2c updated to handle Fortran structuresRon Shepard
|   |    |   ||    `* Re: f2c updated to handle Fortran structuresrobertpa...@gmail.com
|   |    |   ||     `* Re: f2c updated to handle Fortran structuresgah4
|   |    |   ||      `* Re: f2c updated to handle Fortran structuresLouis Krupp
|   |    |   ||       `- Re: f2c updated to handle Fortran structuresDavid Jones
|   |    |   |`* Re: f2c updated to handle Fortran structuresFortranFan
|   |    |   | +* Re: f2c updated to handle Fortran structuresgah4
|   |    |   | |`- Re: f2c updated to handle Fortran structuresRobin Vowels
|   |    |   | `- Re: f2c updated to handle Fortran structuresEv. Drikos
|   |    |   `* Re: f2c updated to handle Fortran structuresEv. Drikos
|   |    |    `* Re: f2c updated to handle Fortran structuresEv. Drikos
|   |    |     `- Re: f2c updated to handle Fortran structuresRon Shepard
|   |    +- Re: f2c updated to handle Fortran structuresgah4
|   |    `- Re: f2c updated to handle Fortran structuresRon Shepard
|   `* Re: f2c updated to handle Fortran structuresGary Scott
|    `* Re: f2c updated to handle Fortran structuresLynn McGuire
|     `* Re: f2c updated to handle Fortran structuresGary Scott
|      `- Re: f2c updated to handle Fortran structuresLynn McGuire
+- Re: f2c updated to handle Fortran structuresBeliavsky
`- Re: f2c updated to handle Fortran structuresCyrMag

Pages:12
f2c updated to handle Fortran structures

<t6orqm$hgp$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2298&group=comp.lang.fortran#2298

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: lynnmcguire5@gmail.com (Lynn McGuire)
Newsgroups: comp.lang.fortran
Subject: f2c updated to handle Fortran structures
Date: Thu, 26 May 2022 16:35:16 -0500
Organization: A noiseless patient Spider
Lines: 11
Message-ID: <t6orqm$hgp$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 26 May 2022 21:35:18 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="04d2e21b0c252086bcfceb8a35db0f39";
logging-data="17945"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18YjV4pUMjcdcOGegYADU0i"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.9.1
Cancel-Lock: sha1:UgrTYtahvrc2zRaK2zn523y/3Aw=
Content-Language: en-US
 by: Lynn McGuire - Thu, 26 May 2022 21:35 UTC

Does know if anyone updated f2c to convert Fortran data structures to C
data structures ?
https://www.netlib.org/f2c/

I am contemplating using a modified f2c to convert our 850,000 lines of
F77 in 5,000 subroutines to C++ code. I will modify f2c to meet my needs.

I asked the Netlib maintainer and he does not know of any.

Thanks,
Lynn

Re: f2c updated to handle Fortran structures

<149d4115-17cb-4201-b71a-603dba352ef5n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2299&group=comp.lang.fortran#2299

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:6214:2485:b0:462:4bf3:a817 with SMTP id gi5-20020a056214248500b004624bf3a817mr17050255qvb.82.1653626320131;
Thu, 26 May 2022 21:38:40 -0700 (PDT)
X-Received: by 2002:a81:8446:0:b0:300:5df4:b49d with SMTP id
u67-20020a818446000000b003005df4b49dmr10224259ywf.5.1653626319902; Thu, 26
May 2022 21:38:39 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Thu, 26 May 2022 21:38:39 -0700 (PDT)
In-Reply-To: <t6orqm$hgp$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:602:9700:4689:189:c74e:c5c0:8252;
posting-account=gLDX1AkAAAA26M5HM-O3sVMAXdxK9FPA
NNTP-Posting-Host: 2601:602:9700:4689:189:c74e:c5c0:8252
References: <t6orqm$hgp$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <149d4115-17cb-4201-b71a-603dba352ef5n@googlegroups.com>
Subject: Re: f2c updated to handle Fortran structures
From: gah4@u.washington.edu (gah4)
Injection-Date: Fri, 27 May 2022 04:38:40 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1585
 by: gah4 - Fri, 27 May 2022 04:38 UTC

On Thursday, May 26, 2022 at 2:35:21 PM UTC-7, Lynn McGuire wrote:
> Does know if anyone updated f2c to convert Fortran data structures to C
> data structures ?
> https://www.netlib.org/f2c/

Since f2c is supposed to be Fortran 77, it wouldn't have structures.

I do remember that some DEC compilers might have had them.

As far as I know, f2c doesn't make readable C code. With some work,
you might get it to do more like what you want to see.

Re: f2c updated to handle Fortran structures

<dc1dd966-a9a1-41f2-8da0-64b750a31130n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2303&group=comp.lang.fortran#2303

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:ae9:ec15:0:b0:6a3:304c:504b with SMTP id h21-20020ae9ec15000000b006a3304c504bmr27134936qkg.662.1653639565212;
Fri, 27 May 2022 01:19:25 -0700 (PDT)
X-Received: by 2002:a5b:489:0:b0:655:be22:4757 with SMTP id
n9-20020a5b0489000000b00655be224757mr10143253ybp.92.1653639565050; Fri, 27
May 2022 01:19:25 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Fri, 27 May 2022 01:19:24 -0700 (PDT)
In-Reply-To: <t6orqm$hgp$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=202.67.103.232; posting-account=S_MdrwoAAAD7T2pxG2e393dk6y0tc0Le
NNTP-Posting-Host: 202.67.103.232
References: <t6orqm$hgp$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <dc1dd966-a9a1-41f2-8da0-64b750a31130n@googlegroups.com>
Subject: Re: f2c updated to handle Fortran structures
From: robin.vowels@gmail.com (Robin Vowels)
Injection-Date: Fri, 27 May 2022 08:19:25 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1613
 by: Robin Vowels - Fri, 27 May 2022 08:19 UTC

On Friday, May 27, 2022 at 7:35:21 AM UTC+10, Lynn McGuire wrote:
> Does know if anyone updated f2c to convert Fortran data structures to C
> data structures ?
> https://www.netlib.org/f2c/
>
> I am contemplating using a modified f2c to convert our 850,000 lines of
> F77 in 5,000 subroutines to C++ code. I will modify f2c to meet my needs.

The F77 code would be better updated to F90 or later form.

Silverfrost f95 can do it as part of the compilation process.
However, it does not transcribe the comments.

Re: f2c updated to handle Fortran structures

<745a0326-b3fb-4b39-b40b-0276fd27ccbcn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2309&group=comp.lang.fortran#2309

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:ad4:4ba8:0:b0:462:69ae:9154 with SMTP id i8-20020ad44ba8000000b0046269ae9154mr10386007qvw.127.1653680037956;
Fri, 27 May 2022 12:33:57 -0700 (PDT)
X-Received: by 2002:a81:9958:0:b0:300:44e0:58d0 with SMTP id
q85-20020a819958000000b0030044e058d0mr4117748ywg.498.1653680037804; Fri, 27
May 2022 12:33:57 -0700 (PDT)
Path: i2pn2.org!i2pn.org!aioe.org!news.mixmin.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Fri, 27 May 2022 12:33:57 -0700 (PDT)
In-Reply-To: <t6orqm$hgp$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=173.76.111.99; posting-account=Ac_J3QkAAABih73tf3Yz4sHazwGUM-hW
NNTP-Posting-Host: 173.76.111.99
References: <t6orqm$hgp$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <745a0326-b3fb-4b39-b40b-0276fd27ccbcn@googlegroups.com>
Subject: Re: f2c updated to handle Fortran structures
From: beliavsky@aol.com (Beliavsky)
Injection-Date: Fri, 27 May 2022 19:33:57 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Beliavsky - Fri, 27 May 2022 19:33 UTC

On Thursday, May 26, 2022 at 5:35:21 PM UTC-4, Lynn McGuire wrote:
> Does know if anyone updated f2c to convert Fortran data structures to C
> data structures ?
> https://www.netlib.org/f2c/
>
> I am contemplating using a modified f2c to convert our 850,000 lines of
> F77 in 5,000 subroutines to C++ code. I will modify f2c to meet my needs.
>
> I asked the Netlib maintainer and he does not know of any.
>
> Thanks,
> Lynn

As I have tweeted https://github.com/Beliavsky/FortranTip/blob/main/topics.md,

Use the bind(c) attribute to make a derived type compatible with C, with restrictions listed at https://gcc.gnu.org/onlinedocs/gfortran/Derived-Types-and-struct.html. For example,

type, bind(c) :: date
integer (kind=c_int) :: year, month
end type

interoperates with

typedef struct {
int year, month;
} date;

Re: f2c updated to handle Fortran structures

<t6revk$crs$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2310&group=comp.lang.fortran#2310

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: lynnmcguire5@gmail.com (Lynn McGuire)
Newsgroups: comp.lang.fortran
Subject: Re: f2c updated to handle Fortran structures
Date: Fri, 27 May 2022 16:14:28 -0500
Organization: A noiseless patient Spider
Lines: 18
Message-ID: <t6revk$crs$1@dont-email.me>
References: <t6orqm$hgp$1@dont-email.me>
<dc1dd966-a9a1-41f2-8da0-64b750a31130n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 27 May 2022 21:14:28 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="b807653cbd0bd6ffd0d5c5369d783ef2";
logging-data="13180"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/3jL4iQOl62uSss23u/Iic"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.9.1
Cancel-Lock: sha1:uq2A0mzFqXTGTPnIMYGLXw4kIpo=
In-Reply-To: <dc1dd966-a9a1-41f2-8da0-64b750a31130n@googlegroups.com>
Content-Language: en-US
 by: Lynn McGuire - Fri, 27 May 2022 21:14 UTC

On 5/27/2022 3:19 AM, Robin Vowels wrote:
> On Friday, May 27, 2022 at 7:35:21 AM UTC+10, Lynn McGuire wrote:
>> Does know if anyone updated f2c to convert Fortran data structures to C
>> data structures ?
>> https://www.netlib.org/f2c/
>>
>> I am contemplating using a modified f2c to convert our 850,000 lines of
>> F77 in 5,000 subroutines to C++ code. I will modify f2c to meet my needs.
>
> The F77 code would be better updated to F90 or later form.
>
> Silverfrost f95 can do it as part of the compilation process.
> However, it does not transcribe the comments.

Please, you are making massive assumptions about my environment.

Lynn

Re: f2c updated to handle Fortran structures

<819baa40-3eae-47e9-88bd-3f5fb289da97n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2311&group=comp.lang.fortran#2311

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a37:4454:0:b0:69f:c339:e2dc with SMTP id r81-20020a374454000000b0069fc339e2dcmr28623946qka.771.1653696022883;
Fri, 27 May 2022 17:00:22 -0700 (PDT)
X-Received: by 2002:a81:8446:0:b0:300:5df4:b49d with SMTP id
u67-20020a818446000000b003005df4b49dmr14880493ywf.5.1653696022686; Fri, 27
May 2022 17:00:22 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Fri, 27 May 2022 17:00:22 -0700 (PDT)
In-Reply-To: <t6orqm$hgp$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=98.194.164.24; posting-account=YGTUIQoAAAAFR372MRGEUx-D9N1L7CrN
NNTP-Posting-Host: 98.194.164.24
References: <t6orqm$hgp$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <819baa40-3eae-47e9-88bd-3f5fb289da97n@googlegroups.com>
Subject: Re: f2c updated to handle Fortran structures
From: cyrmag7@gmail.com (CyrMag)
Injection-Date: Sat, 28 May 2022 00:00:22 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2153
 by: CyrMag - Sat, 28 May 2022 00:00 UTC

On Thursday, May 26, 2022 at 4:35:21 PM UTC-5, Lynn McGuire wrote:
> Does know if anyone updated f2c to convert Fortran data structures to C
> data structures ?
> https://www.netlib.org/f2c/
>
> I am contemplating using a modified f2c to convert our 850,000 lines of
> F77 in 5,000 subroutines to C++ code. I will modify f2c to meet my needs.
>
> I asked the Netlib maintainer and he does not know of any.
>
> Thanks,
> Lynn

This is how f2c is described by its own authors:

"The converter f2c is a copy of the f77 Fortran compiler which has been altered to print out a C representation of the program being converted. The program f2c is a horror, based on ancient code and hacked unmercifully. Users are only supposed to look at its C output, not at its appalling inner workings."

If your 850,000 lines of F77 use nonstandard extensions of Fortran 77 such as DEC structures, unions, Cray pointers, etc., I suggest that you consider something other than f2c.

Re: f2c updated to handle Fortran structures

<cc5d3613-21f3-4426-aeba-4a31a0ec8084n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2315&group=comp.lang.fortran#2315

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a37:de0c:0:b0:69e:cd37:7646 with SMTP id h12-20020a37de0c000000b0069ecd377646mr38116989qkj.449.1653916530883;
Mon, 30 May 2022 06:15:30 -0700 (PDT)
X-Received: by 2002:a81:a002:0:b0:30c:30bd:4587 with SMTP id
x2-20020a81a002000000b0030c30bd4587mr8248521ywg.288.1653916530656; Mon, 30
May 2022 06:15:30 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Mon, 30 May 2022 06:15:30 -0700 (PDT)
In-Reply-To: <t6revk$crs$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=202.67.103.232; posting-account=S_MdrwoAAAD7T2pxG2e393dk6y0tc0Le
NNTP-Posting-Host: 202.67.103.232
References: <t6orqm$hgp$1@dont-email.me> <dc1dd966-a9a1-41f2-8da0-64b750a31130n@googlegroups.com>
<t6revk$crs$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <cc5d3613-21f3-4426-aeba-4a31a0ec8084n@googlegroups.com>
Subject: Re: f2c updated to handle Fortran structures
From: robin.vowels@gmail.com (Robin Vowels)
Injection-Date: Mon, 30 May 2022 13:15:30 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2423
 by: Robin Vowels - Mon, 30 May 2022 13:15 UTC

On Saturday, May 28, 2022 at 7:14:32 AM UTC+10, Lynn McGuire wrote:
> On 5/27/2022 3:19 AM, Robin Vowels wrote:
> > On Friday, May 27, 2022 at 7:35:21 AM UTC+10, Lynn McGuire wrote:
> >> Does know if anyone updated f2c to convert Fortran data structures to C
> >> data structures ?
> >> https://www.netlib.org/f2c/
> >>
> >> I am contemplating using a modified f2c to convert our 850,000 lines of
> >> F77 in 5,000 subroutines to C++ code. I will modify f2c to meet my needs.
> >
> > The F77 code would be better updated to F90 or later form.
> >
> > Silverfrost f95 can do it as part of the compilation process.
> > However, it does not transcribe the comments.
..
> Please, you are making massive assumptions about my environment.
..
Is this the project that for years you have been saying that you
want to convert to modern Fortran ?
..
I have had considerable experience in converting F77 and earlier
to F90+ and other languages,
In the process, I uncovered numbers of bugs in the F77 and
earlier sources.
..
Converting your 850,000 lines of code to F90 would be a
massive enough job of itself, let alone to a completely
different language.
..
That's why I suggested updating the code to F90 or later.

Re: f2c updated to handle Fortran structures

<t744ab$lun$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2316&group=comp.lang.fortran#2316

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: lynnmcguire5@gmail.com (Lynn McGuire)
Newsgroups: comp.lang.fortran
Subject: Re: f2c updated to handle Fortran structures
Date: Mon, 30 May 2022 23:07:37 -0500
Organization: A noiseless patient Spider
Lines: 55
Message-ID: <t744ab$lun$1@dont-email.me>
References: <t6orqm$hgp$1@dont-email.me>
<dc1dd966-a9a1-41f2-8da0-64b750a31130n@googlegroups.com>
<t6revk$crs$1@dont-email.me>
<cc5d3613-21f3-4426-aeba-4a31a0ec8084n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 31 May 2022 04:07:39 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="0fcd3d04e236ab915d512994687f2f46";
logging-data="22487"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18lNpP9QwLuzysc0JeS/qB+"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.9.1
Cancel-Lock: sha1:Ssdv9vTpwTbvwh6wqfAaTG9iRpA=
In-Reply-To: <cc5d3613-21f3-4426-aeba-4a31a0ec8084n@googlegroups.com>
Content-Language: en-US
 by: Lynn McGuire - Tue, 31 May 2022 04:07 UTC

On 5/30/2022 8:15 AM, Robin Vowels wrote:
> On Saturday, May 28, 2022 at 7:14:32 AM UTC+10, Lynn McGuire wrote:
>> On 5/27/2022 3:19 AM, Robin Vowels wrote:
>>> On Friday, May 27, 2022 at 7:35:21 AM UTC+10, Lynn McGuire wrote:
>>>> Does know if anyone updated f2c to convert Fortran data structures to C
>>>> data structures ?
>>>> https://www.netlib.org/f2c/
>>>>
>>>> I am contemplating using a modified f2c to convert our 850,000 lines of
>>>> F77 in 5,000 subroutines to C++ code. I will modify f2c to meet my needs.
>>>
>>> The F77 code would be better updated to F90 or later form.
>>>
>>> Silverfrost f95 can do it as part of the compilation process.
>>> However, it does not transcribe the comments.
> .
>> Please, you are making massive assumptions about my environment.
> .
> Is this the project that for years you have been saying that you
> want to convert to modern Fortran ?
> .
> I have had considerable experience in converting F77 and earlier
> to F90+ and other languages,
> In the process, I uncovered numbers of bugs in the F77 and
> earlier sources.
> .
> Converting your 850,000 lines of code to F90 would be a
> massive enough job of itself, let alone to a completely
> different language.
> .
> That's why I suggested updating the code to F90 or later.

Yes. I have changed my mind. I am going to convert my Fortran
structures to an equivalenced double precision array and a integer*8
array (like I used to have from 1977 to 2002, only an equivalenced
single real array and integer*4 array). Then I am going to start
running my modified f2c on it. F2c already converts integer*8 to a long
long int.

I have been running extensive tests on f2c. The generated c code is
very good about converting the algorithms across the language barrier.
And the code is good (there is one array bug though). The translated
read and write code is freaking horrible so I've got to make it better.
Which, people have already noted and worked on.
https://www.researchgate.net/publication/220281652_Using_stdioh_in_the_Output_of_the_FORTRAN_to_C_Translator_f2c

BTW, my calculation engine is already about 10% C++ code. You cannot do
OLE2 in Fortran and my ZIP code is so highly tied to C bit twiddling. I
use extensive C++ glue code for manipulating embedded Excel spreadsheets
in my calculation engine and allowing my users to embed my calculation
engine in their VB, VBA (Excel VB), and C++ code.

Thanks,
Lynn

Re: f2c updated to handle Fortran structures

<6af2077d-2313-4acf-9d52-639cca5ceecbn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2317&group=comp.lang.fortran#2317

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:622a:3d4:b0:2fb:753a:a0bb with SMTP id k20-20020a05622a03d400b002fb753aa0bbmr23398057qtx.365.1653996631887;
Tue, 31 May 2022 04:30:31 -0700 (PDT)
X-Received: by 2002:a5b:14f:0:b0:656:b905:7cb4 with SMTP id
c15-20020a5b014f000000b00656b9057cb4mr26363134ybp.386.1653996631602; Tue, 31
May 2022 04:30:31 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Tue, 31 May 2022 04:30:31 -0700 (PDT)
In-Reply-To: <t744ab$lun$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=71.192.180.75; posting-account=UKzVQwoAAAC0p4fW4nFhSsDyRRVgSJiF
NNTP-Posting-Host: 71.192.180.75
References: <t6orqm$hgp$1@dont-email.me> <dc1dd966-a9a1-41f2-8da0-64b750a31130n@googlegroups.com>
<t6revk$crs$1@dont-email.me> <cc5d3613-21f3-4426-aeba-4a31a0ec8084n@googlegroups.com>
<t744ab$lun$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <6af2077d-2313-4acf-9d52-639cca5ceecbn@googlegroups.com>
Subject: Re: f2c updated to handle Fortran structures
From: feenberg@gmail.com (Daniel Feenberg)
Injection-Date: Tue, 31 May 2022 11:30:31 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2858
 by: Daniel Feenberg - Tue, 31 May 2022 11:30 UTC

On Tuesday, May 31, 2022 at 12:07:43 AM UTC-4, Lynn McGuire wrote:
> On 5/30/2022 8:15 AM, Robin Vowels wrote:
> > On Saturday, May 28, 2022 at 7:14:32 AM UTC+10, Lynn McGuire wrote:
> >> On 5/27/2022 3:19 AM, Robin Vowels wrote:
> >>> On Friday, May 27, 2022 at 7:35:21 AM UTC+10, Lynn McGuire wrote:
> >>>> Does know if anyone updated f2c to convert Fortran data structures to C
> >>>> data structures ?
> >>>> https://www.netlib.org/f2c/
> >>>>
> >>>> I am contemplating using a modified f2c to convert our 850,000 lines of
> >>>> F77 in 5,000 subroutines to C++ code. I will modify f2c to meet my needs.
> >>>
> >>> The F77 code would be better updated to F90 or later form.
> >>>
> >>> Silverfrost f95 can do it as part of the compilation process.
> >>> However, it does not transcribe the comments.
> > .
> >> Please, you are making massive assumptions about my environment.
> > .
> > Is this the project that for years you have been saying that you
> > want to convert to modern Fortran ?
> > .
> > I have had considerable experience in converting F77 and earlier
> > to F90+ and other languages,
> > In the process, I uncovered numbers of bugs in the F77 and
> > earlier sources.
....
> Which, people have already noted and worked on.
>
> https://www.researchgate.net/publication/220281652_Using_stdioh_in_the_Output_of_the_FORTRAN_to_C_Translator_f2c
>
This URL includes a link to the improved f2c:

http://www.nag.co.uk:70/1h/public

but that link is dead. Does anyone know of an alternative source?

Daniel Feenberg

Re: f2c updated to handle Fortran structures

<t759cr$n4i$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2318&group=comp.lang.fortran#2318

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: garylscott@sbcglobal.net (Gary Scott)
Newsgroups: comp.lang.fortran
Subject: Re: f2c updated to handle Fortran structures
Date: Tue, 31 May 2022 09:40:27 -0500
Organization: A noiseless patient Spider
Lines: 62
Message-ID: <t759cr$n4i$1@dont-email.me>
References: <t6orqm$hgp$1@dont-email.me>
<dc1dd966-a9a1-41f2-8da0-64b750a31130n@googlegroups.com>
<t6revk$crs$1@dont-email.me>
<cc5d3613-21f3-4426-aeba-4a31a0ec8084n@googlegroups.com>
<t744ab$lun$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 31 May 2022 14:40:28 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="2365acf93fc3dfc44cae70992dcf96d2";
logging-data="23698"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19vq+BReQvSgfuBNMTwGILg5O5Q4hYDu5g="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.9.1
Cancel-Lock: sha1:RaFyZcvjJtOUZrGOBRyhOgwEUw4=
In-Reply-To: <t744ab$lun$1@dont-email.me>
Content-Language: en-US
 by: Gary Scott - Tue, 31 May 2022 14:40 UTC

On 5/30/2022 11:07 PM, Lynn McGuire wrote:
> On 5/30/2022 8:15 AM, Robin Vowels wrote:
>> On Saturday, May 28, 2022 at 7:14:32 AM UTC+10, Lynn McGuire wrote:
>>> On 5/27/2022 3:19 AM, Robin Vowels wrote:
>>>> On Friday, May 27, 2022 at 7:35:21 AM UTC+10, Lynn McGuire wrote:
>>>>> Does know if anyone updated f2c to convert Fortran data structures
>>>>> to C
>>>>> data structures ?
>>>>> https://www.netlib.org/f2c/
>>>>>
>>>>> I am contemplating using a modified f2c to convert our 850,000
>>>>> lines of
>>>>> F77 in 5,000 subroutines to C++ code. I will modify f2c to meet my
>>>>> needs.
>>>>
>>>> The F77 code would be better updated to F90 or later form.
>>>>
>>>> Silverfrost f95 can do it as part of the compilation process.
>>>> However, it does not transcribe the comments.
>> .
>>> Please, you are making massive assumptions about my environment.
>> .
>> Is this the project that for years you have been saying that you
>> want to convert  to modern Fortran ?
>> .
>> I have had considerable experience in converting F77 and earlier
>> to F90+ and other languages,
>> In the process, I uncovered numbers of bugs in the F77 and
>> earlier sources.
>> .
>> Converting your 850,000 lines of code to F90 would be a
>> massive enough job of itself, let alone to a completely
>> different language.
>> .
>> That's why I suggested updating the code to F90 or later.
>
> Yes.  I have changed my mind.  I am going to convert my Fortran
> structures to an equivalenced double precision array and a integer*8
> array (like I used to have from 1977 to 2002, only an equivalenced
> single real array and integer*4 array).  Then I am going to start
> running my modified f2c on it.  F2c already converts integer*8 to a long
> long int.
>
> I have been running extensive tests on f2c.  The generated c code is
> very good about converting the algorithms across the language barrier.
> And the code is good (there is one array bug though).  The translated
> read and write code is freaking horrible so I've got to make it better.
>  Which, people have already noted and worked on.
>
> https://www.researchgate.net/publication/220281652_Using_stdioh_in_the_Output_of_the_FORTRAN_to_C_Translator_f2c
>
>
> BTW, my calculation engine is already about 10% C++ code.  You cannot do
> OLE2 in Fortran and my ZIP code is so highly tied to C bit twiddling.  I
> use extensive C++ glue code for manipulating embedded Excel spreadsheets
> in my calculation engine and allowing my users to embed my calculation
> engine in their VB, VBA (Excel VB), and C++ code.
>
> Thanks,
> Lynn

I used DDE, OLE, OLE2, COM from Fortran for decades.

Re: f2c updated to handle Fortran structures

<t75lr9$q05$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2319&group=comp.lang.fortran#2319

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: lynnmcguire5@gmail.com (Lynn McGuire)
Newsgroups: comp.lang.fortran
Subject: Re: f2c updated to handle Fortran structures
Date: Tue, 31 May 2022 13:12:58 -0500
Organization: A noiseless patient Spider
Lines: 68
Message-ID: <t75lr9$q05$1@dont-email.me>
References: <t6orqm$hgp$1@dont-email.me>
<dc1dd966-a9a1-41f2-8da0-64b750a31130n@googlegroups.com>
<t6revk$crs$1@dont-email.me>
<cc5d3613-21f3-4426-aeba-4a31a0ec8084n@googlegroups.com>
<t744ab$lun$1@dont-email.me> <t759cr$n4i$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 31 May 2022 18:12:57 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="162876d2c196fe372b1f706dba7774c4";
logging-data="26629"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+d3ipE3BJAHLzoxaYdspUV"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.9.1
Cancel-Lock: sha1:yg6p6WZRA5hKvGrjttged/wV0ME=
In-Reply-To: <t759cr$n4i$1@dont-email.me>
Content-Language: en-US
 by: Lynn McGuire - Tue, 31 May 2022 18:12 UTC

On 5/31/2022 9:40 AM, Gary Scott wrote:
> On 5/30/2022 11:07 PM, Lynn McGuire wrote:
>> On 5/30/2022 8:15 AM, Robin Vowels wrote:
>>> On Saturday, May 28, 2022 at 7:14:32 AM UTC+10, Lynn McGuire wrote:
>>>> On 5/27/2022 3:19 AM, Robin Vowels wrote:
>>>>> On Friday, May 27, 2022 at 7:35:21 AM UTC+10, Lynn McGuire wrote:
>>>>>> Does know if anyone updated f2c to convert Fortran data structures
>>>>>> to C
>>>>>> data structures ?
>>>>>> https://www.netlib.org/f2c/
>>>>>>
>>>>>> I am contemplating using a modified f2c to convert our 850,000
>>>>>> lines of
>>>>>> F77 in 5,000 subroutines to C++ code. I will modify f2c to meet my
>>>>>> needs.
>>>>>
>>>>> The F77 code would be better updated to F90 or later form.
>>>>>
>>>>> Silverfrost f95 can do it as part of the compilation process.
>>>>> However, it does not transcribe the comments.
>>> .
>>>> Please, you are making massive assumptions about my environment.
>>> .
>>> Is this the project that for years you have been saying that you
>>> want to convert  to modern Fortran ?
>>> .
>>> I have had considerable experience in converting F77 and earlier
>>> to F90+ and other languages,
>>> In the process, I uncovered numbers of bugs in the F77 and
>>> earlier sources.
>>> .
>>> Converting your 850,000 lines of code to F90 would be a
>>> massive enough job of itself, let alone to a completely
>>> different language.
>>> .
>>> That's why I suggested updating the code to F90 or later.
>>
>> Yes.  I have changed my mind.  I am going to convert my Fortran
>> structures to an equivalenced double precision array and a integer*8
>> array (like I used to have from 1977 to 2002, only an equivalenced
>> single real array and integer*4 array).  Then I am going to start
>> running my modified f2c on it.  F2c already converts integer*8 to a
>> long long int.
>>
>> I have been running extensive tests on f2c.  The generated c code is
>> very good about converting the algorithms across the language barrier.
>> And the code is good (there is one array bug though).  The translated
>> read and write code is freaking horrible so I've got to make it
>> better.   Which, people have already noted and worked on.
>>
>> https://www.researchgate.net/publication/220281652_Using_stdioh_in_the_Output_of_the_FORTRAN_to_C_Translator_f2c
>>
>>
>> BTW, my calculation engine is already about 10% C++ code.  You cannot
>> do OLE2 in Fortran and my ZIP code is so highly tied to C bit
>> twiddling.  I use extensive C++ glue code for manipulating embedded
>> Excel spreadsheets in my calculation engine and allowing my users to
>> embed my calculation engine in their VB, VBA (Excel VB), and C++ code.
>>
>> Thanks,
>> Lynn
>
> I used DDE, OLE, OLE2, COM from Fortran for decades.

Sounds like you are better programmer than me. How did you do the wide
character strings in OLE2 ?

Lynn

Re: f2c updated to handle Fortran structures

<t75mn0$2bi$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2320&group=comp.lang.fortran#2320

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: lynnmcguire5@gmail.com (Lynn McGuire)
Newsgroups: comp.lang.fortran
Subject: Re: f2c updated to handle Fortran structures
Date: Tue, 31 May 2022 13:27:43 -0500
Organization: A noiseless patient Spider
Lines: 50
Message-ID: <t75mn0$2bi$1@dont-email.me>
References: <t6orqm$hgp$1@dont-email.me>
<dc1dd966-a9a1-41f2-8da0-64b750a31130n@googlegroups.com>
<t6revk$crs$1@dont-email.me>
<cc5d3613-21f3-4426-aeba-4a31a0ec8084n@googlegroups.com>
<t744ab$lun$1@dont-email.me>
<6af2077d-2313-4acf-9d52-639cca5ceecbn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 31 May 2022 18:27:44 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="162876d2c196fe372b1f706dba7774c4";
logging-data="2418"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18SrPD9ysFFfunIGgBEocCr"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.9.1
Cancel-Lock: sha1:nGlAXQ44lJgzwTsCue1j212bRr8=
In-Reply-To: <6af2077d-2313-4acf-9d52-639cca5ceecbn@googlegroups.com>
Content-Language: en-US
 by: Lynn McGuire - Tue, 31 May 2022 18:27 UTC

On 5/31/2022 6:30 AM, Daniel Feenberg wrote:
> On Tuesday, May 31, 2022 at 12:07:43 AM UTC-4, Lynn McGuire wrote:
>> On 5/30/2022 8:15 AM, Robin Vowels wrote:
>>> On Saturday, May 28, 2022 at 7:14:32 AM UTC+10, Lynn McGuire wrote:
>>>> On 5/27/2022 3:19 AM, Robin Vowels wrote:
>>>>> On Friday, May 27, 2022 at 7:35:21 AM UTC+10, Lynn McGuire wrote:
>>>>>> Does know if anyone updated f2c to convert Fortran data structures to C
>>>>>> data structures ?
>>>>>> https://www.netlib.org/f2c/
>>>>>>
>>>>>> I am contemplating using a modified f2c to convert our 850,000 lines of
>>>>>> F77 in 5,000 subroutines to C++ code. I will modify f2c to meet my needs.
>>>>>
>>>>> The F77 code would be better updated to F90 or later form.
>>>>>
>>>>> Silverfrost f95 can do it as part of the compilation process.
>>>>> However, it does not transcribe the comments.
>>> .
>>>> Please, you are making massive assumptions about my environment.
>>> .
>>> Is this the project that for years you have been saying that you
>>> want to convert to modern Fortran ?
>>> .
>>> I have had considerable experience in converting F77 and earlier
>>> to F90+ and other languages,
>>> In the process, I uncovered numbers of bugs in the F77 and
>>> earlier sources.
> ...
>> Which, people have already noted and worked on.
>>
>> https://www.researchgate.net/publication/220281652_Using_stdioh_in_the_Output_of_the_FORTRAN_to_C_Translator_f2c
>>
> This URL includes a link to the improved f2c:
>
> http://www.nag.co.uk:70/1h/public
>
> but that link is dead. Does anyone know of an alternative source?
>
> Daniel Feenberg

I contacted NAG and they do not have the code anymore. Or they
incorporated it into their Fortran compiler. They were not sure. I did
not talk with the writer of the article though.

I did see something somewhat similar in Koenig's ??? Toolbox but I need
to investigate it further:
https://www.ibiblio.org/pub/Linux/devel/lang/fortran/!INDEX.short.html

Thanks,
Lynn

Re: f2c updated to handle Fortran structures

<t75s97$m55$1@newsreader4.netcologne.de>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2321&group=comp.lang.fortran#2321

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!newsreader4.netcologne.de!news.netcologne.de!.POSTED.2001-4dd7-2bff-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de!not-for-mail
From: tkoenig@netcologne.de (Thomas Koenig)
Newsgroups: comp.lang.fortran
Subject: Re: f2c updated to handle Fortran structures
Date: Tue, 31 May 2022 20:02:47 -0000 (UTC)
Organization: news.netcologne.de
Distribution: world
Message-ID: <t75s97$m55$1@newsreader4.netcologne.de>
References: <t6orqm$hgp$1@dont-email.me>
<dc1dd966-a9a1-41f2-8da0-64b750a31130n@googlegroups.com>
<t6revk$crs$1@dont-email.me>
<cc5d3613-21f3-4426-aeba-4a31a0ec8084n@googlegroups.com>
<t744ab$lun$1@dont-email.me>
<6af2077d-2313-4acf-9d52-639cca5ceecbn@googlegroups.com>
<t75mn0$2bi$1@dont-email.me>
Injection-Date: Tue, 31 May 2022 20:02:47 -0000 (UTC)
Injection-Info: newsreader4.netcologne.de; posting-host="2001-4dd7-2bff-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de:2001:4dd7:2bff:0:7285:c2ff:fe6c:992d";
logging-data="22693"; mail-complaints-to="abuse@netcologne.de"
User-Agent: slrn/1.0.3 (Linux)
 by: Thomas Koenig - Tue, 31 May 2022 20:02 UTC

Lynn McGuire <lynnmcguire5@gmail.com> schrieb:

> I did see something somewhat similar in Koenig's ??? Toolbox but I need
> to investigate it further:
> https://www.ibiblio.org/pub/Linux/devel/lang/fortran/!INDEX.short.html

Certainly not mine, I just ported the source to Linux (from a
HP-UX version) after having had good experience with it on MVS.
It originally came from NAG, I believe.

Toolpack has some nice restructuring features, but is _very_ picky
about strict F77 compliance. It does not even grok IMPLICIT NONE,
for example.

Regarding f2c - I just checked it on my Ubuntu system, and at least
I/O is broken there, something wrong with the library, I suppose.

I am also not sure if the games it plays for array dummy arguments
generate valid C or not. If you look at

subroutine foo(x,n)
dimension x(n)
x(1) = 1.
end

this gets translated to

/* Subroutine */ int foo_(real *x, integer *n)
{ /* Parameter adjustments */
--x;

/* Function Body */
x[1] = 1.f;
return 0;
} /* foo_ */

but for this another forum wold be more appropriate.

Re: f2c updated to handle Fortran structures

<64d9318d-34e8-4f14-a42d-7a29295528e1n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2322&group=comp.lang.fortran#2322

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:6214:c64:b0:462:483f:64ff with SMTP id t4-20020a0562140c6400b00462483f64ffmr36297514qvj.26.1654033001709;
Tue, 31 May 2022 14:36:41 -0700 (PDT)
X-Received: by 2002:a25:6dc5:0:b0:655:bf98:2421 with SMTP id
i188-20020a256dc5000000b00655bf982421mr30024090ybc.633.1654033001573; Tue, 31
May 2022 14:36:41 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Tue, 31 May 2022 14:36:41 -0700 (PDT)
In-Reply-To: <t75s97$m55$1@newsreader4.netcologne.de>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:602:9700:4689:acdf:b88c:d475:57da;
posting-account=gLDX1AkAAAA26M5HM-O3sVMAXdxK9FPA
NNTP-Posting-Host: 2601:602:9700:4689:acdf:b88c:d475:57da
References: <t6orqm$hgp$1@dont-email.me> <dc1dd966-a9a1-41f2-8da0-64b750a31130n@googlegroups.com>
<t6revk$crs$1@dont-email.me> <cc5d3613-21f3-4426-aeba-4a31a0ec8084n@googlegroups.com>
<t744ab$lun$1@dont-email.me> <6af2077d-2313-4acf-9d52-639cca5ceecbn@googlegroups.com>
<t75mn0$2bi$1@dont-email.me> <t75s97$m55$1@newsreader4.netcologne.de>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <64d9318d-34e8-4f14-a42d-7a29295528e1n@googlegroups.com>
Subject: Re: f2c updated to handle Fortran structures
From: gah4@u.washington.edu (gah4)
Injection-Date: Tue, 31 May 2022 21:36:41 +0000
Content-Type: text/plain; charset="UTF-8"
 by: gah4 - Tue, 31 May 2022 21:36 UTC

On Tuesday, May 31, 2022 at 1:02:50 PM UTC-7, Thomas Koenig wrote:

(snip)

> Regarding f2c - I just checked it on my Ubuntu system, and at least
> I/O is broken there, something wrong with the library, I suppose.
>
> I am also not sure if the games it plays for array dummy arguments
> generate valid C or not. If you look at
>
> subroutine foo(x,n)
> dimension x(n)
> x(1) = 1.
> end
> this gets translated to
> /* Subroutine */ int foo_(real *x, integer *n)
> {
> /* Parameter adjustments */
> --x;
> /* Function Body */
> x[1] = 1.f;
> return 0;
> } /* foo_ */
> but for this another forum wold be more appropriate.

This question came up often regarding "Numerical Recipes in C".

The reason it comes up at all in C, is there is no guarantee
that x-1 < x. If you require that, you have to be careful.

C guarantees that x+1 > x for x pointing to an actual variable
or array element, but not that x-1 < x. Don't, for example:

for(x=a+9; x>=a, x--) printf("%s", *x);

Re: f2c updated to handle Fortran structures

<t763dv$fea$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2323&group=comp.lang.fortran#2323

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: lynnmcguire5@gmail.com (Lynn McGuire)
Newsgroups: comp.lang.fortran
Subject: Re: f2c updated to handle Fortran structures
Date: Tue, 31 May 2022 17:04:45 -0500
Organization: A noiseless patient Spider
Lines: 51
Message-ID: <t763dv$fea$1@dont-email.me>
References: <t6orqm$hgp$1@dont-email.me>
<dc1dd966-a9a1-41f2-8da0-64b750a31130n@googlegroups.com>
<t6revk$crs$1@dont-email.me>
<cc5d3613-21f3-4426-aeba-4a31a0ec8084n@googlegroups.com>
<t744ab$lun$1@dont-email.me>
<6af2077d-2313-4acf-9d52-639cca5ceecbn@googlegroups.com>
<t75mn0$2bi$1@dont-email.me> <t75s97$m55$1@newsreader4.netcologne.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 31 May 2022 22:04:47 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="05219a88171c781e7cdfa13f4f69e8e8";
logging-data="15818"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19iAAMfJA72D9ti/R07g+3s"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.10.0
Cancel-Lock: sha1:L960DXvntqMGkgry3wCg8GBF2kk=
In-Reply-To: <t75s97$m55$1@newsreader4.netcologne.de>
Content-Language: en-US
 by: Lynn McGuire - Tue, 31 May 2022 22:04 UTC

On 5/31/2022 3:02 PM, Thomas Koenig wrote:
> Lynn McGuire <lynnmcguire5@gmail.com> schrieb:
>
>> I did see something somewhat similar in Koenig's ??? Toolbox but I need
>> to investigate it further:
>> https://www.ibiblio.org/pub/Linux/devel/lang/fortran/!INDEX.short.html
>
> Certainly not mine, I just ported the source to Linux (from a
> HP-UX version) after having had good experience with it on MVS.
> It originally came from NAG, I believe.
>
> Toolpack has some nice restructuring features, but is _very_ picky
> about strict F77 compliance. It does not even grok IMPLICIT NONE,
> for example.
>
> Regarding f2c - I just checked it on my Ubuntu system, and at least
> I/O is broken there, something wrong with the library, I suppose.
>
> I am also not sure if the games it plays for array dummy arguments
> generate valid C or not. If you look at
>
> subroutine foo(x,n)
> dimension x(n)
> x(1) = 1.
> end
>
> this gets translated to
>
> /* Subroutine */ int foo_(real *x, integer *n)
> {
> /* Parameter adjustments */
> --x;
>
> /* Function Body */
> x[1] = 1.f;
> return 0;
> } /* foo_ */
>
> but for this another forum wold be more appropriate.

That is valid C code and a valid pointer. But we do not like it so we
are going to rip out the --x parameter adjustment and subtract 1 from
the argument array addressing like f2c does for local arrays. That
means that we will not be able to modify portions of our F77 but all of
it at once.

Thanks,
Lynn

Lynn

Re: f2c updated to handle Fortran structures

<t77s6o$g81$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2324&group=comp.lang.fortran#2324

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: garylscott@sbcglobal.net (Gary Scott)
Newsgroups: comp.lang.fortran
Subject: Re: f2c updated to handle Fortran structures
Date: Wed, 1 Jun 2022 09:13:43 -0500
Organization: A noiseless patient Spider
Lines: 72
Message-ID: <t77s6o$g81$1@dont-email.me>
References: <t6orqm$hgp$1@dont-email.me>
<dc1dd966-a9a1-41f2-8da0-64b750a31130n@googlegroups.com>
<t6revk$crs$1@dont-email.me>
<cc5d3613-21f3-4426-aeba-4a31a0ec8084n@googlegroups.com>
<t744ab$lun$1@dont-email.me> <t759cr$n4i$1@dont-email.me>
<t75lr9$q05$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 1 Jun 2022 14:13:44 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="a1067106d63bdb3c7be0b19d043bd0db";
logging-data="16641"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX199dffGv2Di/uvy9L7lg+5IylY10EdNaD8="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.9.1
Cancel-Lock: sha1:jeZICrb/1+ldfUR0Uw4G5wWf1C8=
In-Reply-To: <t75lr9$q05$1@dont-email.me>
Content-Language: en-US
 by: Gary Scott - Wed, 1 Jun 2022 14:13 UTC

On 5/31/2022 1:12 PM, Lynn McGuire wrote:
> On 5/31/2022 9:40 AM, Gary Scott wrote:
>> On 5/30/2022 11:07 PM, Lynn McGuire wrote:
>>> On 5/30/2022 8:15 AM, Robin Vowels wrote:
>>>> On Saturday, May 28, 2022 at 7:14:32 AM UTC+10, Lynn McGuire wrote:
>>>>> On 5/27/2022 3:19 AM, Robin Vowels wrote:
>>>>>> On Friday, May 27, 2022 at 7:35:21 AM UTC+10, Lynn McGuire wrote:
>>>>>>> Does know if anyone updated f2c to convert Fortran data
>>>>>>> structures to C
>>>>>>> data structures ?
>>>>>>> https://www.netlib.org/f2c/
>>>>>>>
>>>>>>> I am contemplating using a modified f2c to convert our 850,000
>>>>>>> lines of
>>>>>>> F77 in 5,000 subroutines to C++ code. I will modify f2c to meet
>>>>>>> my needs.
>>>>>>
>>>>>> The F77 code would be better updated to F90 or later form.
>>>>>>
>>>>>> Silverfrost f95 can do it as part of the compilation process.
>>>>>> However, it does not transcribe the comments.
>>>> .
>>>>> Please, you are making massive assumptions about my environment.
>>>> .
>>>> Is this the project that for years you have been saying that you
>>>> want to convert  to modern Fortran ?
>>>> .
>>>> I have had considerable experience in converting F77 and earlier
>>>> to F90+ and other languages,
>>>> In the process, I uncovered numbers of bugs in the F77 and
>>>> earlier sources.
>>>> .
>>>> Converting your 850,000 lines of code to F90 would be a
>>>> massive enough job of itself, let alone to a completely
>>>> different language.
>>>> .
>>>> That's why I suggested updating the code to F90 or later.
>>>
>>> Yes.  I have changed my mind.  I am going to convert my Fortran
>>> structures to an equivalenced double precision array and a integer*8
>>> array (like I used to have from 1977 to 2002, only an equivalenced
>>> single real array and integer*4 array).  Then I am going to start
>>> running my modified f2c on it.  F2c already converts integer*8 to a
>>> long long int.
>>>
>>> I have been running extensive tests on f2c.  The generated c code is
>>> very good about converting the algorithms across the language
>>> barrier. And the code is good (there is one array bug though).  The
>>> translated read and write code is freaking horrible so I've got to
>>> make it better.   Which, people have already noted and worked on.
>>>
>>> https://www.researchgate.net/publication/220281652_Using_stdioh_in_the_Output_of_the_FORTRAN_to_C_Translator_f2c
>>>
>>>
>>> BTW, my calculation engine is already about 10% C++ code.  You cannot
>>> do OLE2 in Fortran and my ZIP code is so highly tied to C bit
>>> twiddling.  I use extensive C++ glue code for manipulating embedded
>>> Excel spreadsheets in my calculation engine and allowing my users to
>>> embed my calculation engine in their VB, VBA (Excel VB), and C++ code.
>>>
>>> Thanks,
>>> Lynn
>>
>> I used DDE, OLE, OLE2, COM from Fortran for decades.
>
> Sounds like you are better programmer than me.  How did you do the wide
> character strings in OLE2 ?
>
> Lynn
Structures and various operating system APIs allow interoperability. I
generally wrote simpler internal APIs to call from Fortran that did the
hard work and made it easier to use.

Re: f2c updated to handle Fortran structures

<OwLlK.2424$sW.1876@fx37.iad>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2325&group=comp.lang.fortran#2325

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.uzoreto.com!feeder.usenetexpress.com!tr2.eu1.usenetexpress.com!feeder1.feed.usenet.farm!feed.usenet.farm!peer01.ams4!peer.am4.highwinds-media.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx37.iad.POSTED!not-for-mail
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:91.0) Gecko/20100101 Thunderbird/91.9.1
Subject: Re: f2c updated to handle Fortran structures
Content-Language: en-US
Newsgroups: comp.lang.fortran
References: <t6orqm$hgp$1@dont-email.me> <dc1dd966-a9a1-41f2-8da0-64b750a31130n@googlegroups.com> <t6revk$crs$1@dont-email.me> <cc5d3613-21f3-4426-aeba-4a31a0ec8084n@googlegroups.com> <t744ab$lun$1@dont-email.me> <6af2077d-2313-4acf-9d52-639cca5ceecbn@googlegroups.com> <t75mn0$2bi$1@dont-email.me> <t75s97$m55$1@newsreader4.netcologne.de> <t763dv$fea$1@dont-email.me>
From: nospam@nowhere.org (Ron Shepard)
In-Reply-To: <t763dv$fea$1@dont-email.me>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Lines: 47
Message-ID: <OwLlK.2424$sW.1876@fx37.iad>
X-Complaints-To: abuse@easynews.com
Organization: Forte - www.forteinc.com
X-Complaints-Info: Please be sure to forward a copy of ALL headers otherwise we will be unable to process your complaint properly.
Date: Wed, 1 Jun 2022 10:24:30 -0500
X-Received-Bytes: 3174
 by: Ron Shepard - Wed, 1 Jun 2022 15:24 UTC

On 5/31/22 5:04 PM, Lynn McGuire wrote:
[...]
>> I am also not sure if the games it plays for array dummy arguments
>> generate valid C or not.  If you look at
>>
>>        subroutine foo(x,n)
>>        dimension x(n)
>>        x(1) = 1.
>>        end
>>
>> this gets translated to
>>
>> /* Subroutine */ int foo_(real *x, integer *n)
>> {
>>      /* Parameter adjustments */
>>      --x;
>>
>>      /* Function Body */
>>      x[1] = 1.f;
>>      return 0;
>> } /* foo_ */
>>
>> but for this another forum wold be more appropriate.
>
> That is valid C code and a valid pointer.
[...]

Others have already stated how it violates the C standard. The reason
for this restriction in C was that the array concept was based on a
segmented memory model. If the first element of the array happened to be
at a segment boundary, then decrementing the pointer meant that the
address was no longer necessarily even within the program's address
space. Depending on the OS, it could be pointing at some part of the OS,
or in a multitasking environment to the memory of another process. Then
later when virtual memory became popular, it could have resulted in page
address violations, depending on how exactly the virtual and actual
memory were mapped to each other. Such address computations could
trigger errors, even if the pointers were never referenced. The upper
range of the pointers were accounted for in the language. I think the
restriction was that the pointer was allowed to go one unit outside of
the array bound, but it could not be dereferenced once it was there.
There was no such allowance for the lower bound of the array, the
language simply did not allow the pointer outside that range, whether or
not it was later referenced or, as in the above example, incremented
back to within the valid array range.

$.02 -Ron Shepard

Re: f2c updated to handle Fortran structures

<t789i8$sr$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2326&group=comp.lang.fortran#2326

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: lynnmcguire5@gmail.com (Lynn McGuire)
Newsgroups: comp.lang.fortran
Subject: Re: f2c updated to handle Fortran structures
Date: Wed, 1 Jun 2022 13:01:42 -0500
Organization: A noiseless patient Spider
Lines: 79
Message-ID: <t789i8$sr$1@dont-email.me>
References: <t6orqm$hgp$1@dont-email.me>
<dc1dd966-a9a1-41f2-8da0-64b750a31130n@googlegroups.com>
<t6revk$crs$1@dont-email.me>
<cc5d3613-21f3-4426-aeba-4a31a0ec8084n@googlegroups.com>
<t744ab$lun$1@dont-email.me> <t759cr$n4i$1@dont-email.me>
<t75lr9$q05$1@dont-email.me> <t77s6o$g81$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 1 Jun 2022 18:01:44 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="1df721be30d555b75dabe97579c57b01";
logging-data="923"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19isa77JYknGRmLa8iIaWa1"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.9.1
Cancel-Lock: sha1:9WP9PibQcU2BOBDe8wvAbzS6uWk=
In-Reply-To: <t77s6o$g81$1@dont-email.me>
Content-Language: en-US
 by: Lynn McGuire - Wed, 1 Jun 2022 18:01 UTC

On 6/1/2022 9:13 AM, Gary Scott wrote:
> On 5/31/2022 1:12 PM, Lynn McGuire wrote:
>> On 5/31/2022 9:40 AM, Gary Scott wrote:
>>> On 5/30/2022 11:07 PM, Lynn McGuire wrote:
>>>> On 5/30/2022 8:15 AM, Robin Vowels wrote:
>>>>> On Saturday, May 28, 2022 at 7:14:32 AM UTC+10, Lynn McGuire wrote:
>>>>>> On 5/27/2022 3:19 AM, Robin Vowels wrote:
>>>>>>> On Friday, May 27, 2022 at 7:35:21 AM UTC+10, Lynn McGuire wrote:
>>>>>>>> Does know if anyone updated f2c to convert Fortran data
>>>>>>>> structures to C
>>>>>>>> data structures ?
>>>>>>>> https://www.netlib.org/f2c/
>>>>>>>>
>>>>>>>> I am contemplating using a modified f2c to convert our 850,000
>>>>>>>> lines of
>>>>>>>> F77 in 5,000 subroutines to C++ code. I will modify f2c to meet
>>>>>>>> my needs.
>>>>>>>
>>>>>>> The F77 code would be better updated to F90 or later form.
>>>>>>>
>>>>>>> Silverfrost f95 can do it as part of the compilation process.
>>>>>>> However, it does not transcribe the comments.
>>>>> .
>>>>>> Please, you are making massive assumptions about my environment.
>>>>> .
>>>>> Is this the project that for years you have been saying that you
>>>>> want to convert  to modern Fortran ?
>>>>> .
>>>>> I have had considerable experience in converting F77 and earlier
>>>>> to F90+ and other languages,
>>>>> In the process, I uncovered numbers of bugs in the F77 and
>>>>> earlier sources.
>>>>> .
>>>>> Converting your 850,000 lines of code to F90 would be a
>>>>> massive enough job of itself, let alone to a completely
>>>>> different language.
>>>>> .
>>>>> That's why I suggested updating the code to F90 or later.
>>>>
>>>> Yes.  I have changed my mind.  I am going to convert my Fortran
>>>> structures to an equivalenced double precision array and a integer*8
>>>> array (like I used to have from 1977 to 2002, only an equivalenced
>>>> single real array and integer*4 array).  Then I am going to start
>>>> running my modified f2c on it.  F2c already converts integer*8 to a
>>>> long long int.
>>>>
>>>> I have been running extensive tests on f2c.  The generated c code is
>>>> very good about converting the algorithms across the language
>>>> barrier. And the code is good (there is one array bug though).  The
>>>> translated read and write code is freaking horrible so I've got to
>>>> make it better.   Which, people have already noted and worked on.
>>>>
>>>> https://www.researchgate.net/publication/220281652_Using_stdioh_in_the_Output_of_the_FORTRAN_to_C_Translator_f2c
>>>>
>>>>
>>>> BTW, my calculation engine is already about 10% C++ code.  You
>>>> cannot do OLE2 in Fortran and my ZIP code is so highly tied to C bit
>>>> twiddling.  I use extensive C++ glue code for manipulating embedded
>>>> Excel spreadsheets in my calculation engine and allowing my users to
>>>> embed my calculation engine in their VB, VBA (Excel VB), and C++ code.
>>>>
>>>> Thanks,
>>>> Lynn
>>>
>>> I used DDE, OLE, OLE2, COM from Fortran for decades.
>>
>> Sounds like you are better programmer than me.  How did you do the
>> wide character strings in OLE2 ?
>>
>> Lynn
> Structures and various operating system APIs allow interoperability.  I
> generally wrote simpler internal APIs to call from Fortran that did the
> hard work and made it easier to use.

Yes. I updated my Fortran code to call my OLE2 C++ code from my Win32
user interface when I needed to have two way discussions between my
calculation engine and Microsoft Excel.

Lynn

Re: f2c updated to handle Fortran structures

<t789sh$dfi$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2327&group=comp.lang.fortran#2327

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: lynnmcguire5@gmail.com (Lynn McGuire)
Newsgroups: comp.lang.fortran
Subject: Re: f2c updated to handle Fortran structures
Date: Wed, 1 Jun 2022 13:07:08 -0500
Organization: A noiseless patient Spider
Lines: 55
Message-ID: <t789sh$dfi$1@dont-email.me>
References: <t6orqm$hgp$1@dont-email.me>
<dc1dd966-a9a1-41f2-8da0-64b750a31130n@googlegroups.com>
<t6revk$crs$1@dont-email.me>
<cc5d3613-21f3-4426-aeba-4a31a0ec8084n@googlegroups.com>
<t744ab$lun$1@dont-email.me>
<6af2077d-2313-4acf-9d52-639cca5ceecbn@googlegroups.com>
<t75mn0$2bi$1@dont-email.me> <t75s97$m55$1@newsreader4.netcologne.de>
<t763dv$fea$1@dont-email.me> <OwLlK.2424$sW.1876@fx37.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 1 Jun 2022 18:07:13 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="1df721be30d555b75dabe97579c57b01";
logging-data="13810"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19zdvtvIEDIHa1W25YLCNqz"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.9.1
Cancel-Lock: sha1:cV/wQ4ITnY6U3xz9GNvPbwAa6Mc=
In-Reply-To: <OwLlK.2424$sW.1876@fx37.iad>
Content-Language: en-US
 by: Lynn McGuire - Wed, 1 Jun 2022 18:07 UTC

On 6/1/2022 10:24 AM, Ron Shepard wrote:
> On 5/31/22 5:04 PM, Lynn McGuire wrote:
> [...]
>>> I am also not sure if the games it plays for array dummy arguments
>>> generate valid C or not.  If you look at
>>>
>>>        subroutine foo(x,n)
>>>        dimension x(n)
>>>        x(1) = 1.
>>>        end
>>>
>>> this gets translated to
>>>
>>> /* Subroutine */ int foo_(real *x, integer *n)
>>> {
>>>      /* Parameter adjustments */
>>>      --x;
>>>
>>>      /* Function Body */
>>>      x[1] = 1.f;
>>>      return 0;
>>> } /* foo_ */
>>>
>>> but for this another forum wold be more appropriate.
>>
>> That is valid C code and a valid pointer.
> [...]
>
> Others have already stated how it violates the C standard. The reason
> for this restriction in C was that the array concept was based on a
> segmented memory model. If the first element of the array happened to be
> at a segment boundary, then decrementing the pointer meant that the
> address was no longer necessarily even within the program's address
> space. Depending on the OS, it could be pointing at some part of the OS,
> or in a multitasking environment to the memory of another process. Then
> later when virtual memory became popular, it could have resulted in page
> address violations, depending on how exactly the virtual and actual
> memory were mapped to each other. Such address computations could
> trigger errors, even if the pointers were never referenced. The upper
> range of the pointers were accounted for in the language. I think the
> restriction was that the pointer was allowed to go one unit outside of
> the array bound, but it could not be dereferenced once it was there.
> There was no such allowance for the lower bound of the array, the
> language simply did not allow the pointer outside that range, whether or
> not it was later referenced or, as in the above example, incremented
> back to within the valid array range.
>
> $.02 -Ron Shepard

Yes, very true. I am so used to programming in flat address planes now
that I don't even think about the good old days with segment pointers,
etc. Hopefully, we will never go back to those. After all, I am
starting the journey to 64 bit now.

Lynn

Re: f2c updated to handle Fortran structures

<8f5b4351-198f-4e24-a5db-69d3042d09ban@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2328&group=comp.lang.fortran#2328

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:620a:4310:b0:67b:3fc1:86eb with SMTP id u16-20020a05620a431000b0067b3fc186ebmr854112qko.495.1654112293695;
Wed, 01 Jun 2022 12:38:13 -0700 (PDT)
X-Received: by 2002:a5b:14f:0:b0:656:b905:7cb4 with SMTP id
c15-20020a5b014f000000b00656b9057cb4mr1520212ybp.386.1654112293501; Wed, 01
Jun 2022 12:38:13 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Wed, 1 Jun 2022 12:38:13 -0700 (PDT)
In-Reply-To: <OwLlK.2424$sW.1876@fx37.iad>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:602:9700:4689:184c:289d:1c14:adad;
posting-account=gLDX1AkAAAA26M5HM-O3sVMAXdxK9FPA
NNTP-Posting-Host: 2601:602:9700:4689:184c:289d:1c14:adad
References: <t6orqm$hgp$1@dont-email.me> <dc1dd966-a9a1-41f2-8da0-64b750a31130n@googlegroups.com>
<t6revk$crs$1@dont-email.me> <cc5d3613-21f3-4426-aeba-4a31a0ec8084n@googlegroups.com>
<t744ab$lun$1@dont-email.me> <6af2077d-2313-4acf-9d52-639cca5ceecbn@googlegroups.com>
<t75mn0$2bi$1@dont-email.me> <t75s97$m55$1@newsreader4.netcologne.de>
<t763dv$fea$1@dont-email.me> <OwLlK.2424$sW.1876@fx37.iad>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <8f5b4351-198f-4e24-a5db-69d3042d09ban@googlegroups.com>
Subject: Re: f2c updated to handle Fortran structures
From: gah4@u.washington.edu (gah4)
Injection-Date: Wed, 01 Jun 2022 19:38:13 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 4919
 by: gah4 - Wed, 1 Jun 2022 19:38 UTC

On Wednesday, June 1, 2022 at 8:24:36 AM UTC-7, Ron Shepard wrote:

(snip)

> Others have already stated how it violates the C standard. The reason
> for this restriction in C was that the array concept was based on a
> segmented memory model.

Well, even more than segmented, there used to be machines with
a tagged memory model. Each location had tags as to what kind
of value was stored there.

> If the first element of the array happened to be
> at a segment boundary, then decrementing the pointer meant that the
> address was no longer necessarily even within the program's address
> space.

Well, this could happen even without segmented memory, if the
array happened to be at the bottom of memory.

(To get back to the topic of this group, early Fortran compilers
allocated memory from the top of the address space down. Arrays
were stored in decreasing addresses in memory.)

In any case, yes, with protected mode x86, you can't load a segment
selector that doesn't select a valid segment descriptor, except for
the null selector, 0. In large model, though, only the offset is changed
with pointer arithmetic. In huge model, it will also change the
segment number. Even so, though, compilers usually won't load a
selector until you actually reference it, mostly because of code
like that. C guarantees that you can have a pointer to one past the
end of an array, and, more specifically, that it compares greater
than pointers into the array. That allows for loop tests based
on pointer values. Also, C doesn't allow (or doesn't define the
effect of) comparing pointers to different data items.

In the 80286 days, I was running OS/2 1.0 or 1.2, and allocating
segment selectors directly from the OS, with the exact length.
It was, then, a hardware exception even reading an array element
outside the array, and with no extra overhead. Very good for debugging
programs that might not be so good with array references.

> Depending on the OS, it could be pointing at some part of the OS,
> or in a multitasking environment to the memory of another process. Then
> later when virtual memory became popular, it could have resulted in page
> address violations, depending on how exactly the virtual and actual
> memory were mapped to each other.

Protected mode x86 is based on segments with a selector
and length. But as above, compilers would avoid unneeded
selector access to avoid the problem.

> Such address computations could
> trigger errors, even if the pointers were never referenced. The upper
> range of the pointers were accounted for in the language. I think the
> restriction was that the pointer was allowed to go one unit outside of
> the array bound, but it could not be dereferenced once it was there.

Yes. And so one less than the addressable space.

> There was no such allowance for the lower bound of the array, the
> language simply did not allow the pointer outside that range, whether or
> not it was later referenced or, as in the above example, incremented
> back to within the valid array range.

As above, compilers were good at avoiding that, but even so it can
still cause problems. Large model 16 bit x86 code only changes the offset,
and for other than equality and inequality, only compares the offset.
Even though it doesn't generate any access problems, the comparison
can fail.

Re: f2c updated to handle Fortran structures

<30a62c0b-6c3b-4e85-a1df-0a707d0c7327n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2329&group=comp.lang.fortran#2329

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:6214:21aa:b0:45a:a8d7:ecd6 with SMTP id t10-20020a05621421aa00b0045aa8d7ecd6mr24395544qvc.100.1654112790222;
Wed, 01 Jun 2022 12:46:30 -0700 (PDT)
X-Received: by 2002:a81:8102:0:b0:2f8:f5fb:b805 with SMTP id
r2-20020a818102000000b002f8f5fbb805mr1358476ywf.128.1654112790090; Wed, 01
Jun 2022 12:46:30 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Wed, 1 Jun 2022 12:46:29 -0700 (PDT)
In-Reply-To: <t789sh$dfi$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:602:9700:4689:184c:289d:1c14:adad;
posting-account=gLDX1AkAAAA26M5HM-O3sVMAXdxK9FPA
NNTP-Posting-Host: 2601:602:9700:4689:184c:289d:1c14:adad
References: <t6orqm$hgp$1@dont-email.me> <dc1dd966-a9a1-41f2-8da0-64b750a31130n@googlegroups.com>
<t6revk$crs$1@dont-email.me> <cc5d3613-21f3-4426-aeba-4a31a0ec8084n@googlegroups.com>
<t744ab$lun$1@dont-email.me> <6af2077d-2313-4acf-9d52-639cca5ceecbn@googlegroups.com>
<t75mn0$2bi$1@dont-email.me> <t75s97$m55$1@newsreader4.netcologne.de>
<t763dv$fea$1@dont-email.me> <OwLlK.2424$sW.1876@fx37.iad> <t789sh$dfi$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <30a62c0b-6c3b-4e85-a1df-0a707d0c7327n@googlegroups.com>
Subject: Re: f2c updated to handle Fortran structures
From: gah4@u.washington.edu (gah4)
Injection-Date: Wed, 01 Jun 2022 19:46:30 +0000
Content-Type: text/plain; charset="UTF-8"
 by: gah4 - Wed, 1 Jun 2022 19:46 UTC

On Wednesday, June 1, 2022 at 11:07:16 AM UTC-7, Lynn McGuire wrote:

(snip)

> Yes, very true. I am so used to programming in flat address planes now
> that I don't even think about the good old days with segment pointers,
> etc. Hopefully, we will never go back to those. After all, I am
> starting the journey to 64 bit now.

Reminds me, not so long ago I was working on a Fortran program
from the Fortran 66 days. There was then, and still isn't, short circuit
evaluation for logical expressions. This program had lots of

IF(J.LE.100 .AND. X(J).NE.0) ...

(for example) testing the array subscript and testing an array
value in the same IF statement. With many memory models,
that isn't much of a problem, especially if J stays close to the
ends of the array. However, it fails if bounds check is on.

I wanted to check the program for actual bounds errors,
and so had to change a lot of those!

Re: f2c updated to handle Fortran structures

<t78hka$6iv$1@newsreader4.netcologne.de>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2330&group=comp.lang.fortran#2330

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!.POSTED.2001-4dd7-2bff-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de!not-for-mail
From: tkoenig@netcologne.de (Thomas Koenig)
Newsgroups: comp.lang.fortran
Subject: Re: f2c updated to handle Fortran structures
Date: Wed, 1 Jun 2022 20:19:22 -0000 (UTC)
Organization: news.netcologne.de
Distribution: world
Message-ID: <t78hka$6iv$1@newsreader4.netcologne.de>
References: <t6orqm$hgp$1@dont-email.me>
<dc1dd966-a9a1-41f2-8da0-64b750a31130n@googlegroups.com>
<t6revk$crs$1@dont-email.me>
<cc5d3613-21f3-4426-aeba-4a31a0ec8084n@googlegroups.com>
<t744ab$lun$1@dont-email.me>
<6af2077d-2313-4acf-9d52-639cca5ceecbn@googlegroups.com>
<t75mn0$2bi$1@dont-email.me> <t75s97$m55$1@newsreader4.netcologne.de>
<t763dv$fea$1@dont-email.me> <OwLlK.2424$sW.1876@fx37.iad>
<t789sh$dfi$1@dont-email.me>
<30a62c0b-6c3b-4e85-a1df-0a707d0c7327n@googlegroups.com>
Injection-Date: Wed, 1 Jun 2022 20:19:22 -0000 (UTC)
Injection-Info: newsreader4.netcologne.de; posting-host="2001-4dd7-2bff-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de:2001:4dd7:2bff:0:7285:c2ff:fe6c:992d";
logging-data="6751"; mail-complaints-to="abuse@netcologne.de"
User-Agent: slrn/1.0.3 (Linux)
 by: Thomas Koenig - Wed, 1 Jun 2022 20:19 UTC

gah4 <gah4@u.washington.edu> schrieb:

> Reminds me, not so long ago I was working on a Fortran program
> from the Fortran 66 days. There was then, and still isn't, short circuit
> evaluation for logical expressions. This program had lots of
>
> IF(J.LE.100 .AND. X(J).NE.0) ...
>
> (for example) testing the array subscript and testing an array
> value in the same IF statement. With many memory models,
> that isn't much of a problem, especially if J stays close to the
> ends of the array. However, it fails if bounds check is on.
>
> I wanted to check the program for actual bounds errors,
> and so had to change a lot of those!

A bit more problematic:

if (x .ne. 0. .and. y/x > 123.) then

....

Conditional expressions in Fortran will make it possible to
rewrite this as (hope I get this right)

if (( .not. x /= 0 ? .false. : y/x > 123.))

but the advantage of readability over

if (x .ne. 0) then
if (x/y > 123.) then

is certainly up for debate.

Re: f2c updated to handle Fortran structures

<632dcbbd-628a-4c1c-9f78-aa921a464f0dn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2331&group=comp.lang.fortran#2331

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:622a:44b:b0:2f3:f495:386b with SMTP id o11-20020a05622a044b00b002f3f495386bmr2054664qtx.349.1654133475607;
Wed, 01 Jun 2022 18:31:15 -0700 (PDT)
X-Received: by 2002:a25:ed0e:0:b0:65d:119d:fb60 with SMTP id
k14-20020a25ed0e000000b0065d119dfb60mr2901214ybh.456.1654133475365; Wed, 01
Jun 2022 18:31:15 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Wed, 1 Jun 2022 18:31:15 -0700 (PDT)
In-Reply-To: <t78hka$6iv$1@newsreader4.netcologne.de>
Injection-Info: google-groups.googlegroups.com; posting-host=173.76.111.99; posting-account=Ac_J3QkAAABih73tf3Yz4sHazwGUM-hW
NNTP-Posting-Host: 173.76.111.99
References: <t6orqm$hgp$1@dont-email.me> <dc1dd966-a9a1-41f2-8da0-64b750a31130n@googlegroups.com>
<t6revk$crs$1@dont-email.me> <cc5d3613-21f3-4426-aeba-4a31a0ec8084n@googlegroups.com>
<t744ab$lun$1@dont-email.me> <6af2077d-2313-4acf-9d52-639cca5ceecbn@googlegroups.com>
<t75mn0$2bi$1@dont-email.me> <t75s97$m55$1@newsreader4.netcologne.de>
<t763dv$fea$1@dont-email.me> <OwLlK.2424$sW.1876@fx37.iad>
<t789sh$dfi$1@dont-email.me> <30a62c0b-6c3b-4e85-a1df-0a707d0c7327n@googlegroups.com>
<t78hka$6iv$1@newsreader4.netcologne.de>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <632dcbbd-628a-4c1c-9f78-aa921a464f0dn@googlegroups.com>
Subject: Re: f2c updated to handle Fortran structures
From: beliavsky@aol.com (Beliavsky)
Injection-Date: Thu, 02 Jun 2022 01:31:15 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2928
 by: Beliavsky - Thu, 2 Jun 2022 01:31 UTC

On Wednesday, June 1, 2022 at 4:19:26 PM UTC-4, Thomas Koenig wrote:
> gah4 <ga...@u.washington.edu> schrieb:
> > Reminds me, not so long ago I was working on a Fortran program
> > from the Fortran 66 days. There was then, and still isn't, short circuit
> > evaluation for logical expressions. This program had lots of
> >
> > IF(J.LE.100 .AND. X(J).NE.0) ...
> >
> > (for example) testing the array subscript and testing an array
> > value in the same IF statement. With many memory models,
> > that isn't much of a problem, especially if J stays close to the
> > ends of the array. However, it fails if bounds check is on.
> >
> > I wanted to check the program for actual bounds errors,
> > and so had to change a lot of those!
> A bit more problematic:
>
> if (x .ne. 0. .and. y/x > 123.) then
>
> ...
>
> Conditional expressions in Fortran will make it possible to
> rewrite this as (hope I get this right)
>
> if (( .not. x /= 0 ? .false. : y/x > 123.))
>
> but the advantage of readability over
>
> if (x .ne. 0) then
> if (x/y > 123.) then
>
> is certainly up for debate.

I have wondered why certain statements are not allowed after the test
in the Fortran one-line if statement. Often I want to write something like

if (i > 0) if (x(i) > 0.0) print*,"i, x(i)=",i,x(i)

Re: f2c updated to handle Fortran structures

<dd205a61-2516-439b-93a2-71ce7f616bb0n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2332&group=comp.lang.fortran#2332

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:620a:16d9:b0:6a3:75cc:3224 with SMTP id a25-20020a05620a16d900b006a375cc3224mr1799486qkn.458.1654135106996;
Wed, 01 Jun 2022 18:58:26 -0700 (PDT)
X-Received: by 2002:a25:cc4e:0:b0:65c:854b:c111 with SMTP id
l75-20020a25cc4e000000b0065c854bc111mr3056657ybf.218.1654135106818; Wed, 01
Jun 2022 18:58:26 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Wed, 1 Jun 2022 18:58:26 -0700 (PDT)
In-Reply-To: <632dcbbd-628a-4c1c-9f78-aa921a464f0dn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:602:9700:4689:f9d7:b973:fc20:de4c;
posting-account=gLDX1AkAAAA26M5HM-O3sVMAXdxK9FPA
NNTP-Posting-Host: 2601:602:9700:4689:f9d7:b973:fc20:de4c
References: <t6orqm$hgp$1@dont-email.me> <dc1dd966-a9a1-41f2-8da0-64b750a31130n@googlegroups.com>
<t6revk$crs$1@dont-email.me> <cc5d3613-21f3-4426-aeba-4a31a0ec8084n@googlegroups.com>
<t744ab$lun$1@dont-email.me> <6af2077d-2313-4acf-9d52-639cca5ceecbn@googlegroups.com>
<t75mn0$2bi$1@dont-email.me> <t75s97$m55$1@newsreader4.netcologne.de>
<t763dv$fea$1@dont-email.me> <OwLlK.2424$sW.1876@fx37.iad>
<t789sh$dfi$1@dont-email.me> <30a62c0b-6c3b-4e85-a1df-0a707d0c7327n@googlegroups.com>
<t78hka$6iv$1@newsreader4.netcologne.de> <632dcbbd-628a-4c1c-9f78-aa921a464f0dn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <dd205a61-2516-439b-93a2-71ce7f616bb0n@googlegroups.com>
Subject: Re: f2c updated to handle Fortran structures
From: gah4@u.washington.edu (gah4)
Injection-Date: Thu, 02 Jun 2022 01:58:26 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2235
 by: gah4 - Thu, 2 Jun 2022 01:58 UTC

On Wednesday, June 1, 2022 at 6:31:17 PM UTC-7, Beliavsky wrote:

(snip)

> I have wondered why certain statements are not allowed after the test
> in the Fortran one-line if statement. Often I want to write something like
> if (i > 0) if (x(i) > 0.0) print*,"i, x(i)=",i,x(i)

As far as I know, it goes back to Fortran 66, and wasn't changed since.

In Fortran 66 days, compilers had to fit in small amounts of memory on
many machines, so some features were kept out.

Yes, I would have liked that.

Re: f2c updated to handle Fortran structures

<2616a2e6-f7c1-4f38-a47d-cc7b5400e960n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2333&group=comp.lang.fortran#2333

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:ac8:7fc8:0:b0:304:bb17:5442 with SMTP id b8-20020ac87fc8000000b00304bb175442mr2423457qtk.323.1654148091281;
Wed, 01 Jun 2022 22:34:51 -0700 (PDT)
X-Received: by 2002:a81:4ccb:0:b0:30c:71ba:6e1a with SMTP id
z194-20020a814ccb000000b0030c71ba6e1amr3620325ywa.431.1654148089738; Wed, 01
Jun 2022 22:34:49 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Wed, 1 Jun 2022 22:34:49 -0700 (PDT)
In-Reply-To: <632dcbbd-628a-4c1c-9f78-aa921a464f0dn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=202.67.103.232; posting-account=S_MdrwoAAAD7T2pxG2e393dk6y0tc0Le
NNTP-Posting-Host: 202.67.103.232
References: <t6orqm$hgp$1@dont-email.me> <dc1dd966-a9a1-41f2-8da0-64b750a31130n@googlegroups.com>
<t6revk$crs$1@dont-email.me> <cc5d3613-21f3-4426-aeba-4a31a0ec8084n@googlegroups.com>
<t744ab$lun$1@dont-email.me> <6af2077d-2313-4acf-9d52-639cca5ceecbn@googlegroups.com>
<t75mn0$2bi$1@dont-email.me> <t75s97$m55$1@newsreader4.netcologne.de>
<t763dv$fea$1@dont-email.me> <OwLlK.2424$sW.1876@fx37.iad>
<t789sh$dfi$1@dont-email.me> <30a62c0b-6c3b-4e85-a1df-0a707d0c7327n@googlegroups.com>
<t78hka$6iv$1@newsreader4.netcologne.de> <632dcbbd-628a-4c1c-9f78-aa921a464f0dn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <2616a2e6-f7c1-4f38-a47d-cc7b5400e960n@googlegroups.com>
Subject: Re: f2c updated to handle Fortran structures
From: robin.vowels@gmail.com (Robin Vowels)
Injection-Date: Thu, 02 Jun 2022 05:34:51 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3215
 by: Robin Vowels - Thu, 2 Jun 2022 05:34 UTC

On Thursday, June 2, 2022 at 11:31:17 AM UTC+10, Beliavsky wrote:
> On Wednesday, June 1, 2022 at 4:19:26 PM UTC-4, Thomas Koenig wrote:
> > gah4 <ga...@u.washington.edu> schrieb:
> > > Reminds me, not so long ago I was working on a Fortran program
> > > from the Fortran 66 days. There was then, and still isn't, short circuit
> > > evaluation for logical expressions. This program had lots of
> > >
> > > IF(J.LE.100 .AND. X(J).NE.0) ...
> > >
> > > (for example) testing the array subscript and testing an array
> > > value in the same IF statement. With many memory models,
> > > that isn't much of a problem, especially if J stays close to the
> > > ends of the array. However, it fails if bounds check is on.
> > >
> > > I wanted to check the program for actual bounds errors,
> > > and so had to change a lot of those!
> > A bit more problematic:
> >
> > if (x .ne. 0. .and. y/x > 123.) then
> >
> > ...
> >
> > Conditional expressions in Fortran will make it possible to
> > rewrite this as (hope I get this right)
> >
> > if (( .not. x /= 0 ? .false. : y/x > 123.))
> >
> > but the advantage of readability over
> >
> > if (x .ne. 0) then
> > if (x/y > 123.) then
> >
> > is certainly up for debate.
> I have wondered why certain statements are not allowed after the test
> in the Fortran one-line if statement. Often I want to write something like
>
> if (i > 0) if (x(i) > 0.0) print*,"i, x(i)=",i,x(i)
..
Try
if (i > 0) then ; if (x(i) > 0.0) print etc ; end if

Pages:12
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor