Subject: Re: exit() undefined in bootloader build
To: None <gat7634@hotmail.com>
From: John Darrow <John.P.Darrow@wheaton.edu>
List: tech-kern
Date: 06/01/2002 16:06:38
Gary Thorpe <gat7634@hotmail.com> wrote:
> Matthias Drochner <M.Drochner@fz-juelich.de> wrote:
>>After all, we also have a "void main(void)" in some bootloaders,
>
>I am surprised the ANSI/ISO standard bearers on the lists did not die of 
>rage when this was posted. Could some of those holding copies of the 
>standard and so willing to quote it please comment on "void main(void)"??? 
>As far as I know, main is ALWAYS required to return int in ANSI C. Has this 
>changed with the latest drafts of the ISO and/or ANSI standards?

I don't have a copy of the ANSI standards here, so I can't quote the
exact wording, but the requirement for main() to be one of int
main(void) or int main(int, char *[]) (and the associated comment
deriding "void main(void)") is specific to a hosted environment, such
as a userland program, and not to a standalone environment, such as a
bootloader.  The kernel itself is void main(void) - see
src/sys/kern/init_main.c.

jdarrow

-- 
John Darrow - Senior Technical Specialist               Office: 630/752-5201
Computing Services, Wheaton College, Wheaton, IL 60187  Fax:    630/752-5968
Pager via email: 6303160707@alphapage.airtouch.com      Pager:  630/316-0707
Email: John.P.Darrow@wheaton.edu (plain text please, no HTML or proprietary)