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: <20010424081352.B166E19A61@mail.cse.psu.edu> Date: Tue, 24 Apr 2001 09:10:56 +0100 Topicbox-Message-UUID: 8d76355e-eac9-11e9-9e20-41e7f4b1d025 i realised later that i hadn't pointed out that regardless whether int main was a good choice for the C standard, it had further disadvantages in plan 9. plan 9 does not use an integer for exit status: it uses a string. if it's considered desirable to return status from main, it would need to be char*, which is still different from the C standard. it could remain int if a return of zero mapped to "" and non-zero mapped to "glenda", but exits(char*) would still need to be called by main in general. if that appears at the end of main, compilers that detect flowing off the end of a function-returning-value will either give a diagnostic or need some hack (another pragma, great) to know about exits. all right, you could have some function to set a int->char* map for the return value of main but things are already getting out of hand. void main was the better choice.