Question about linking files

John F Carr jfc at athena.mit.edu
Mon Mar 27 13:17:17 AEST 1989


In article <16546 at mimsy.UUCP> chris at mimsy.UUCP (Chris Torek) writes:
>>Given that the pANS does not have the concept of a `library', or
>>even of `separate compilation', ...

>The VAX-assembly-code function foo() [deleted] calls whichever function is
>linked immediately following it, so eliding that function because it
>appears unused changes the execution.

Does the standard have anything to say about linking to programs written
in other languages, or even compiled by different compilers?  Would a 
compiler & environment (i.e. linker) that loaded by C function instead of
file (and therefore broke the deleted example) be conforming?  Assume
that this hypothetical compiler works correctly on all C programs.

A more important problem is this:  there are at least two strategies for
passing structures to and from functions.  One is to pass the structure
on the stack, the other is for the caller to pass a pointer.  Modules
compiled using different methods will not work together.  Does the
standard offer any guidance in this case?  As long as not all compilers are
bug-free, there will be reasons to use different compilers on parts of the
same program.  

(My guess at the answer to the above questions: "the standard can not attempt
to define behavior when different compilers are used for different source
files, or when interacting with languages other than standard C.")

--
   John Carr             "When they turn the pages of history,
   jfc at Athena.mit.edu     When these days have passed long ago,
   bloom-beacon!          Will they read of us with sadness
   athena.mit.edu!jfc     For the seeds that we let grow?"  --Neil Peart



More information about the Comp.lang.c mailing list