Re:Main is usually a function, so when is it not? (2015)
by clarry on Sunday September 10, 2017 @11:14AM
(#15212525)
> "main" is not specified in the high-level language, but by the OS. You write some machine code, give it the name "main" and the OS jumps to that location
main() is specified by C. The OS as such doesn't know or care about main. Headers in the binary executable specify where the OS should begin execution, and this is rarely in main.
Re:Main is usually a function, so when is it not? (2015)
by monochromatic on Sunday September 10, 2017 @01:39PM
(#15213275)
If you're feeding source code to a C compiler, it makes sense to ask whether or not it contains UB.
But "main is not a function" does not produce undefined behavior.