Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxn!ihnp4!ucbvax!ttrdc.UUCP!levy From: levy@ttrdc.UUCP Newsgroups: mod.computers.vax Subject: (none) Message-ID: <8606170258.AA13691@ucbvax.Berkeley.EDU> Date: Mon, 16-Jun-86 22:58:23 EDT Article-I.D.: ucbvax.8606170258.AA13691 Posted: Mon Jun 16 22:58:23 1986 Date-Received: Thu, 19-Jun-86 07:45:05 EDT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The ARPA Internet Lines: 37 Approved: info-vax@sri-kl.arpa Subject: Re: Important change to VMS C v2.2 with VMS v4.4 In-reply-to: your article <8606140748.AA14243@ucbvax.Berkeley.EDU> In article <8606140748.AA14243@ucbvax.Berkeley.EDU>, LEICHTER-JERRY@YALE.ARPA writes: >The use of this "first function will be transfer address" feature should >probably be avoided - it's non-portable (though I'd guess it's in VAX C >exactly because other implementations did this - Unix is one, in fact - and >programs came to rely on it. > -- Jerry >------- Don't badmouth UNIX so quickly. Here's what happens in SysV: $ cat foo.c foo() { printf("hello, world!\n"); } $ cc -o foo foo.c undefined first referenced symbol in file main /lib/crt0.o ld fatal: Symbol referencing errors. No output written to foo The interpretation of this is that the UNIX linker was looking for a main() to satisfy the reference by the startup routines contained in the object module /lib/crt0.o (there is a _start() routine in /lib/crt0.o which the linker treats as a hardwired "transfer address" and which calls main()). The linker did not find main() so it barfed. Simple, no? -- ------------------------------- Disclaimer: The views contained herein are | dan levy | yvel nad | my own and are not at all those of my em- | an engihacker @ | ployer or the administrator of any computer | at&t computer systems division | upon which I may hack. | skokie, illinois | -------------------------------- Path: ..!{akgua,homxb,ihnp4,ltuxa,mvuxa, vax135}!ttrdc!levy