Mail Archives: djgpp/1997/10/29/08:37:29
Peter Palotas <blizzar AT hem1 DOT passagen DOT se> wrote:
> Howcome this is such a debated issue? Let the people who doesn't want to
> return anything do so if that makes them happy. A program will compile
> anyway, even if main isn't declared to return an int, possibly with a
> warning, but sometimes not even that (depending on what compiler you use).
> Personally I always declare main to return an integer since this is the
> right thing to do, but it isn't neccessary as far as I can see, if you
> don't want to return anything from main().
If you allow 'void main()' to be valid, you also allow 'if(1 + 1 == 3)' to be
a true comparison.
The standard says main() shall return int, and so int it shall return.
--
[- firewind -]
[- email: firewind AT metroid DOT dyn DOT ml DOT org (home), firewind AT aurdev DOT com (work) -]
[- "You're just jealous because the voices talk to -me-." -]
[- Have a good day, and enjoy your C. -]
[- (on a crusade of grumpiness where grumpiness is due) -]
- Raw text -