This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: First basic program


bjorn rohde jensen <bjensen at fastmail dot fm> writes:

> Hi there,
> 
>   Opinions differ,

The opinions of the C (89,95,99) and C++ standards have always been
    the same: main must return int.

'void main()' first came out of Microsoft before the first C standard
    was finalized in 1988. Why it continues to come out of Microsoft
    is beyond me; perhaps their coding standards are still in the
    80s. :-)

> but it has always been my understanding
> that main should be declared as returning int:) gcc seems
> to think so too.

Correct.

[Other correcct stuff about a.out snipped.]


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]