5 ms·
Actually the message quoted complains about the lack of _main not main, so the rest of this post is a huge overinterpretation. _main is IMO some windoizm connec
by mbq 13y ago
Actually the message quoted complains about the lack of _main not main, so the rest of this post is a huge overinterpretation. _main is IMO some windoizm connected to the use of WinMain for GUI apps.
- morganwilde 13y agoAre you trying to dispute the fact that `main()` is THE entry point for any C program? I'd be interested in hearing a more comprehensive explanation.
- mbq 13y agoTo some extent, _start is (https://blogs.oracle.com/ksplice/entry/hello_from_a_libc_free https://blogs.oracle.com/ksplice/entry/hello_from_a_libc_fre...), so you can make a working program that has no main(). And in general entry points are a quirky land heavily dependent on OS and compilation stack.
- simias 13y agoA C program starts at the function "main", what you're discussing here is beyond the scope of the C language. C without the libc or any other form of runtime is not standard C. I'm not trying to nitpick but I'm worried newcomers to the language might be misled by your comments, the things you're talking about are not a concern for most coders unless they have to do things like low level embedded code, bootloaders and things like that. And then your entrypoint won't be "start" anyway, it'll be the reset vector or some lower stage jumping to a specific address for instance.
- mbq 13y agoSure, I'm only trying to criticize the idea of learning language from error messages triggered by invalid (due to standards) input, as they directly take you to implementation details and other dirty stuff.
- NAFV_P 13y ago> I'm not trying to nitpick but I'm worried newcomers to the language might be misled by your comments I'd better not mention the IOCCC then.
- deletes 13y ago-1, Learn don't guess. http://stackoverflow.com/questions/2627511/why-do-c-compilers-prepend-underscores-to-external-names http://stackoverflow.com/questions/2627511/why-do-c-compiler...
- mbq 13y agoYeah, got me making the same error as I was complaining about. Thanks for the link though.