Anton Petrusevich said:
As I understand it: run-time either calls void main() or it does not. It
can't be "mysterious", I see it as a "defined" behaviour.
You understand it incorrectly. The standard says that main shall
be defined with no parameters:
int main(void); /* or equivalent */
or with two parameters:
int main(int argc, char *argv[]); /* or equivalent */
or in some other implementation-defined manner. If an
implementation's documentation does not explicitly state that it
supports some other definition, then there is no "other
implementation-defined manner", and the two standard definitions are
the only ones allowed.
Since this is a "shall" requirement that's not part of a constraint,
violating it invokes undefined behavior.
A conforming implementation could reject "void main(void){}", or it
could cause it to behave in any perverse manner it chooses.
An implementation is allowed to support void main(void), but even
if it does, the following:
void main(void)
{
/* whatever */
}
is almost certainly equivalent to this:
int main(void)
{
/* whatever */
return 0;
}
and since the latter is portable, there is no advantage in using the
former.
Oh, yes, I see it now. I would call it "religious thing". I am not
religious, though I write "int main()" too. I just don't pay so big
attention to such things. I am a newbie in this conference and I am very
surprised seeing such a "religious thing" here.
There's nothing religious about it. It's a matter of correctness
about which there are strong feelings, largely because certain people
and/or institutions have encouraged something that is incorrect for no
good reason. Perhaps the word "religious" doesn't mean what you think
it means. (And if you want to discuss that further, please take it to
alt.usage.english.)