[Info-vax] Fortran

Dave Froble davef at tsoft-inc.com
Wed Dec 5 21:11:34 EST 2018


On 12/5/2018 8:23 PM, Bill Gunshannon wrote:
> On 12/5/18 1:29 PM, Scott Dorsey wrote:
>> Simon Clubley  <clubley at remove_me.eisner.decus.org-Earth.UFP> wrote:
>>> On 2018-12-05, Bill Gunshannon <bill.gunshannon at gmail.com> wrote:
>>>>
>>>> The only problem I have ever seen with COMMON BLOCKS was inconsistent
>>>> definitions.  :-)
>>>
>>> And _that_ is _exactly_ the point. In any modern language, the
>>> common block would be defined _once_ as a data type and then
>>> multiple instances of that data type used as required.
>>
>> But in Fortran someone modifies the common block and recompiles all the
>> routines that they think uses the common block and then relinks, but
>> unbeknownst to him there's an .OBJ file hidden in some subdirectory
>> somewhere which was compiled with the old common block definition.
>> And now we have a problem which very intermittently pops up in a
>> seemingly
>> unrelated piece of code using a variable that isn't even in the common
>> block
>> (but is located in memory right after the common block).  Six months of
>> DEBUG hell later...
>
> The scarier part is when you find a program that has been
> around for decades with such errors and still works just fine. :-)
>
> Hint: the PL/M compiler
>
>>
>>> Fortunately, there are language enhancements which also help tackle
>>> this problem in modern Fortran.
>>
>> Didn't Knuth say that global variables should be banned?
>
> And Dijkstra said GOTO's should, too.  How did that work out?
>
> bill
>
>

Well, Dave says that absolutes should be banned, there are always 
exceptions.

-- 
David Froble                       Tel: 724-529-0450
Dave Froble Enterprises, Inc.      E-Mail: davef at tsoft-inc.com
DFE Ultralights, Inc.
170 Grimplin Road
Vanderbilt, PA  15486



More information about the Info-vax mailing list