Subject: Re: egcs 1.0.2 and netbsd.
To: matthew green <mrg@eterna.com.au>
From: Alan Barrett <apb@iafrica.com>
List: tech-toolchain
Date: 03/25/1998 11:26:19
> there remains one problem.  the kernel has main looking like:
> 	void main(void *framep);
> which egcs warngs about.  there _is_ a -Wno-main, but this does not get
> rid of the "main does not return int" warning, as the source to egcs
> _specifically_ warns this even if -Wno-main is in effect -- ie, it is
> broken on purpose, IMO.  i will be disabling this warning in our tree.

The ANSI C standard defines a hosted environment and a freestanding
environment.  Several things are relaxed in a freestanding environment,
including what library functions are available, what type main returns,
what args it takes, and even whether the function called at program
startup is named "main".

I think that the Right Thing would be to add a -ffreestanding flag to
gcc/egcs, and have that flag turn off the type checking on main().  When
the -ffreestanding option is not used, main() should be typechecked.

--apb (Alan Barrett)