Jack Scheible writes:
> > If a circular dependency existed, would a compiler catch it?
>
> > I.e.
>
> > mod A uses mod B
> > mod B uses mod C
> > mod C uses mod A
>
> The compiler would not catch it, but mod A could never compile,
> because B would not exist.
Not necessarily so. Perhaps in some other world where code springs
to life complete and never gets modified. In this life, however,
it is quite easy to incrementally introduce such a circular dependency
by adding the final USE in some modification after the earlier,
non-circular code had been compiled, so that a module file would
exist.
As a previous poster mentioned (sorry, I didn't save the article to
give a proper attribution) there is a fair chance that the compiler
will catch it because of apparent duplicate declarations. I don't
recall for sure whether I've actually tested the ability of compilers
to detect this (but I'm sure that if I did so, it must have been an
intentional compiler test; couldn't possibly have been just a simple
code bug :-)).
I don't recall that the original poster mentioned how his makefile
was generated; nor did I see a sample of the actual makefile. I
suspect that this kind of information might be more informative
than anything about the fortran source. Unless it is some fancy
"automake" system, the Fortran source doesn't directly affect what
gets compiled. (Presumably there is an indirect effect, but we'd
need to know how the makefile was generated to tell much about that).
--
Richard Maine
[log in to unmask]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|