Xref: utzoo comp.lang.fortran:3592 comp.lang.c:31075 comp.unix.questions:24601 Path: utzoo!attcan!uunet!gistdev!flint From: flint@gistdev.gist.com (Flint Pellett) Newsgroups: comp.lang.fortran,comp.lang.c,comp.unix.questions Subject: Re: the f2c program Message-ID: <937@gistdev.gist.com> Date: 13 Aug 90 15:35:39 GMT References: <1990Aug11.202542.9891@ux1.cso.uiuc.edu> <1990Aug12.005836.5356@zoo.toronto.edu> Followup-To: comp.lang.fortran Organization: Global Information Systems Technology Inc., Savoy, IL Lines: 40 f2c seems to do a reasonable job of translating, if you don't want to have to work with/on the resulting C code, but only need to compile it. The worst feature of f2c (IMHO) is that it moves all your data up to the top of the file, leaving the comments (that explain the data) where they were. Example: if your Fortran code starts with 40 lines that look roughly like this: c Data used as arguments to foo() function: data abc,def,ghi/1,2,3/ c Data used as arguments to bar() function: data uvw,xyz/4,5/ it gets turned into gibberish because you end up with 20 lines of the variables and values, followed by 20 lines of comments to explain them: But you no longer know know what data element each comment refers to, especially when there are variable numbers of lines of comments about each data element/group. A second thing that would be nice to see improved would be to have an option to not screw up the comments. (They seem to insist on reformatting the comments, chopping them off to about a 70 column line, so that what was a 1 line comment gets broken into two lines that are easily recombinable back into 1- but who wants to have to manually recombine thousands of lines of comments to make them readable? I've also noted that it always breaks the comments at a quote mark for some reason, so contractions in your comments don't (<-like that) stay together: the line ends up like this: /* comments don 't (<-like that) stay together: the line ends up like this */ It ought to just take a block of comments, stick a /* line before them, convert the leading "c" into a *, and stick a */ line after them, and not reformat them at all, except maybe for searching for the random /* or */ within the FORTRAN comment. -- Flint Pellett, Global Information Systems Technology, Inc. 1800 Woodfield Drive, Savoy, IL 61874 (217) 352-1165 uunet!gistdev!flint or flint@gistdev.gist.com