News for hackers. Stuff that matters.
Re:C Internals by _kst_ on Tuesday June 02, 2020 @11:26AM (#23392009)
For a freestanding implementation, the program entry point is entirely implementation-defined. It may or may not be called "main". In that kind of environment, "void main()" (or, better, "void main(void)") might be correct. You need to read the implementation's documentation.

For hosted implementations, "void main()" might be valid, but "int main(void)" is always valid.

A tutorial should not suggest "void main()" without mentioning any of this.

Reference: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf sections 5.1.2.1 (freestanding environments) and 5.1.2.2.1 (hosted environments).

There are no comments on this comment yet.