Subject: Re: main return...
To: Peter Seebach <firstname.lastname@example.org>
From: John F. Woods <jfw@FunHouse.com>
Date: 03/20/1996 23:19:04
> Would anyone *object* to enabling the gcc hack for detecting invalid return
> types from main, and returning 0 automatically if no return is specified?
I would object. Now, if it automatically made demons fly from one's nose
if it detects an invalid return type, that I could go for.
> If there are no objections, I'll probably send-pr this. It's a trivial
> thing (one line in config/netbsd.h) and will help NetBSD users everywhere
> write better C.
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.
(I know, your motivation is probably to get these skanky programs functioning
in shell scripts, rather than rooting out bad code, but the harder it is for
people to excuse bad programming habits with "well, it works on my compiler!",
the fewer bad programming habits we'll all have to put up with...)