Mail Archives: djgpp/1997/10/29/15:28:13
At 07.06 1997-10-29 GMT, you wrote:
>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.
If this is so, why doesn't the compiler generate an error for declaring
main() as 'void main()'?
-- Peter Palotas alias Blizzar -- blizzar AT hem1 DOT passagen DOT se --
*****************************************************
* A brief description of DJGPP: *
* NEVER BEFORE HAS SO FEW DONE SO MUCH FOR SO MANY! *
*****************************************************
- Raw text -