Re: Wrapping routines
- From: nospam@xxxxxxxxxxxxx (Richard Maine)
- Date: Mon, 12 Nov 2007 13:03:13 -0800
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
.
- Follow-Ups:
- Re: Wrapping routines
- From: Arjen Markus
- Re: Wrapping routines
- References:
- Wrapping routines
- From: Arjen Markus
- Wrapping routines
- Prev by Date: Wrapping routines
- Next by Date: Re: vim, ctags, and fortran source browsing
- Previous by thread: Wrapping routines
- Next by thread: Re: Wrapping routines
- Index(es):
Relevant Pages
|