[log in to unmask] said:
> I was promoting this idea a couple of years ago (either here or in the
> Fortran newsgroup). The response I got was that this was too
> cumbersome, since it required you to make the declarations of your
> procedure and its arguments in two different places. And, it still
> wouldn't guarantee that the interface would be properly checked - the
> programmer is merely on his honor to actually USE the interface
> module anyway. The impression I got was that this idea would never
> even be considered by the committee.
[And, it still wouldn't guarantee that the interface would be properly checked...]
That is my other wanted feature: the compiler option -noimplicit that would
flag errors for all procedure/function calls that has no explicit interface.
Most compilers has this option for variables today, but it would be an even
better feature if it was expanded to also control procedure references.
> I don't find either of the objections to the idea particularly
> compelling. They *are* legitimate objections though. Suppose you
> change the interface, but subsequently link to an old version of the
> actual code. This will cause you to use the program with a mismatched
> interface (unless you also have a load-time test - but with such a
> thing you could get by without interfaces entirely).
The IBM XLF compiler has this and it is rather nice really. One draw-back
is though that the amount of information stored in the object files is not
sufficient to tell the programmer where the offending source code lines
are. Only that calls to a named subroutine in an object file is not
consistent with the actual subroutine itself. Usually this is enough to be
able to find the error with reasonable effort, but it is not as detailed
information as you get from the compile step when you use interfaces.
Another nice feature of this load time checks is that you can verify that
common blocks are declared with the same size across object files and thus
catch many of the most common common-block-errors.
/Nils
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Nils Smeds (formerly Jönsson) http://www.pdc.kth.se/
Center for Parallel Computers e-mail: [log in to unmask]
Royal Institute of Technology Voice: +46-8-7909115
KTH Fax: +46-8-247784
S-100 44 Stockholm, Sweden Office: OB2, room 1546
-----------------------------------------------------------------------
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|