From mboxrd@z Thu Jan 1 00:00:00 1970 To: 9fans@cse.psu.edu Subject: Re: [9fans] the declaration of main() From: forsyth@caldo.demon.co.uk MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Message-Id: <20010426182650.3DDB3199D7@mail.cse.psu.edu> Date: Thu, 26 Apr 2001 19:23:57 +0100 Topicbox-Message-UUID: 9213cff4-eac9-11e9-9e20-41e7f4b1d025 >>Except for Plan 9's native (non-APE) and some standalone environments, main() *does* >>in fact return an int, even if many programmers believed >>otherwise. oh well, i had good reason for my own belief: cpu% cat s4/crt0.s / C runtime startoff .globl savr5 .globl _main start: setd mov sp,r0 mov (r0),-(sp) tst (r0)+ mov r0,2(sp) jsr pc,_main cmp (sp)+,(sp)+ clr r0 sys exit .bss savr5: .=.+2 it doesn't look like main returns much to me. given that the language hadn't even got void at that point, how else was it to be declared but main(...)