|
|
On 4/20/2012 0:15, Le_Forgeron wrote:
> Linker will not remove either. (because it has no way to know if the one
> in unit A is identical to the one in unit B: naming is no use, you might
> have compiled unit A with the version of Monday, and unit B with the
> version of Saturday.
I don't think mis-matched declarations were ever something that C worried
about. Does C++ actually check that sort of thing now?
I know that with Ada, you can't link incompatible object code, in the sense
that if you have (the equivalent of) A.h and A.c and B.c, and B.c uses A.h,
then both A.c and B.c have to get compiled after A.h gets compiled. If you
go change A.h after you've already compiled A.c, you can no longer link
against the old binary. The compiler winds up doing stuff like putting the
hashes of every header file (equivalent) into each object code generated,
and then checking they all match up at link time.
--
Darren New, San Diego CA, USA (PST)
"Oh no! We're out of code juice!"
"Don't panic. There's beans and filters
in the cabinet."
Post a reply to this message
|
|