Re: extern "C" ... again
- From: Victor Bazarov <v.Abazarov@xxxxxxxxxxxx>
- Date: Thu, 24 Jul 2008 10:15:59 -0400
Pelle wrote:
[..]
Let me see what I got...
So, there is a convention, not a standard or rule. However, this
convention is somewhat like an unwritten law, since you don't get
anywhere without it. More so, the convention is not based on a
language or language implementation, but rather on the OS.
Now this is really a step forward in understanding those interfaces.
But if so, why is every post I have read on interfacing different
languages, including C and C++ so intent on claiming that there is no
standard as to how it is done and it's most likely to encounter
incompatibilities (like the different voltages on car-electricity you
mentioned)?
I would hazard a guess that you get a very generic answer to your quite generic question. What's governing the compiler development for those languages? Why, their Standards, of course. Is there anything written in the Standards of any of the two languages about how such interfacing is to be done at the compiler level? Of course not. It's left to the compiler implementors. Why so? Because establishing rules that cannot be followed by all would put an undue strain on the development of compilers and go against the principle to allow as wide spread of the language as possible.
If you look at the history of many popular compilers, you will most likely see a tendency to keep the convention as long as possible with all the benefits and drawbacks of allowing the backward compatibility. Of course, you will also find instances when such conventions had to change and force libraries and code that uses them to be recompiled. It's not frequent, but I am sure it has happened. I bet you that nobody can tell you with 100% certainty how those interfaces work (although the interfaces has probably worked the same way for quite a few years now) because it implies the promise of how they will work in the future, which, in the case of C and C++ interoperability, cannot be made.
Well, maybe it's a bit like some (very few) old fashioned cars and
motorcycles, which matter of fact don't use 12V power, but rather 6V.
They do exist, because it's not required to have them at 12V, but they
are very few and can be neglected!?
I am certain that you can find a piece of a still-working system with the source and libraries it was built from, but it will be unrecognizable by modern compilers and linkers. Stuff does become obsolete, you know; faster in our field than anywhere else.
If you don't mind, please take the time for one more answer.
I don't mind. If I am unavailable to respond, I am sure your questions are going to be answered by others, often more qualified people than yours truly.
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
.
- References:
- extern "C" ... again
- From: Pelle
- Re: extern "C" ... again
- From: Victor Bazarov
- Re: extern "C" ... again
- From: Pelle
- extern "C" ... again
- Prev by Date: Re: extern "C" ... again
- Next by Date: How to convert time from one timezone to another?
- Previous by thread: Re: extern "C" ... again
- Next by thread: How to convert time from one timezone to another?
- Index(es):
Relevant Pages
|