POV-Ray : Newsgroups : povray.off-topic : Teach yourself C++ in 21 days : Re: Days 5- Server Time
29 Jul 2024 20:24:52 EDT (-0400)
  Re: Days 5-  
From: Darren New
Date: 20 Apr 2012 23:43:18
Message: <4f922cd6$1@news.povray.org>
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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.