Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!bloom-beacon!athena.mit.edu!jfc From: jfc@athena.mit.edu (John F Carr) Newsgroups: comp.lang.c Subject: Re: Question about linking files Message-ID: <10126@bloom-beacon.MIT.EDU> Date: 27 Mar 89 03:17:17 GMT References: <18925@iuvax.cs.indiana.edu> <16541@mimsy.UUCP> <16546@mimsy.UUCP> Sender: daemon@bloom-beacon.MIT.EDU Reply-To: jfc@athena.mit.edu (John F Carr) Organization: Massachusetts Institute of Technology Lines: 31 In article <16546@mimsy.UUCP> chris@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@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