Subject: Re: main return...
To: None <current-users@NetBSD.ORG>
From: Waldi Ravens <email@example.com>
Date: 03/22/1996 07:39:48
der Mouse wrote:
> >> Would anyone *object* to enabling the gcc hack for detecting invalid
> >> return types from main, and returning 0 automatically if [it trips]?
> > If this is an added warning, then I'm actually all for it. I'd even
> > suggest returning NON-zero to make the error even more glaringly
> > obvious.
> Why just return nonzero? Why not call abort()?
Since cc1 would have to detect this bug at compile-time anyway, it
might as well produce a compile-time error (not a warning). A good
compiler should not try to guess what the programmer could have
ment, when he wrote erroneous code; it should *reject* such