warning: return type of main is not int

Alexandre Oliva oliva@dcc.unicamp.br
Mon Jan 19 02:30:00 GMT 1998


Mike Stump writes:

>> From: Byeong-ryeol Kim <jinbo21@soback.kornet.nm.kr>

>> I often met this warning after installing egcs on rh 5.0.
>> Is this harmless?
>> void main(int argc, char *argv[])

> return 0, if you don't know of a
> better value to return.

In fact, you don't even have to bother about returning anything, since
falling off function `main' is equivalent to returning 0, as defined
in [basic.start.main]/5

-- 
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil



More information about the Gcc mailing list