Subject: Re: egcs 1.0.2 and netbsd.
To: Alan Barrett <>
From: Perry E. Metzger <>
List: tech-toolchain
Date: 03/25/1998 09:54:29
I highly agree. The only time we don't want to typecheck main() is in
freestanding code: bootblocks and kernels, in our case.

The EGCS people are fairly cool, so if we do a "freestanding" option
I'm almost certain they'll take it.


Alan Barrett writes:
> > 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)