Re: Wrapping routines



Arjen Markus <arjen.markus@xxxxxxxxxx> wrote:

- routine sub_a is part of a module mod_a.
....
- I now have a third module - with the same name "mod_a"...
[and he made it work]

My question is:
Is this a mere coincidence? Or is this actually supposed to work this
way?

No, and no. Those aren't two opposite choices.

I would not say that it was a coincidence. It seems like a direct
consequence of some possible implementation choices. No, I don't know
the details of implementation that makes this work, but I'm quite
willing to take your word for it that you managed to make it work with
those compilers.

But it definitely is not "supposed" to work. Having two modules with the
same name is a clear violation of the standard. That's not even worth
the effort for me to look up and copy the citation; it isn't exactly a
subtle case.

You just managed to hide the issue from the compiler. I would not count
on this working with all compilers. As I noted, it is definitely
nonstandard. But it isn't the kind of thing that compilers are required
to be able to diagnose. (Good thing, as it is hard to see how a compiler
could sensibly diagnose it the way you managed to hide it. I could see
that, depending on implementation details, it might or might not work,
but I don't see how it would be easy to sensibly diagnose at compile
time.)

--
Richard Maine | Good judgement comes from experience;
email: last name at domain . net | experience comes from bad judgement.
domain: summertriangle | -- Mark Twain
.



Relevant Pages

  • Re: Wrapping routines
    ... Is this a mere coincidence? ... on this working with all compilers. ... could sensibly diagnose it the way you managed to hide it. ... that, depending on implementation details, it might or might not work, ...
    (comp.lang.fortran)
  • Re: Can the last record in a direct access file be shorter than the record length?
    ... I have run into a small issue with direct-access files (within the ... some compilers use record lengths expressed in "words" ... but that may be a mere coincidence. ... To illustrate the problem more concretely, here is a sample program ...
    (comp.lang.fortran)