Mark McIntyre said:
I don't propose to discuss this any further after this, but I need to
clarify the above, since you've seen fit to complain about it.
About four years ago, I argued strongly FOR precisely the
interpretation that is currently put on the words "or in some other
implementation defined manner". I was however shouted down by several
experts, who made strong arguments against my PoV. I accepted their
apparently greater wisdom.
Hmm. I don't remember that discussion, so I can't comment on it.
I can only base my arguments on what the standard actually says.
So you will understand that I'm amused yet annoyed to see at least
some of the same experts now arguing the other side of the coin, and
even more entertained to see them vigorously attacking my posts.
Assuming your description of the earlier discussion to be accurate,
yes, amusement and annoyance would be appropriate. On the other hand,
I can't exclude the possibility that you've misinterpreted the earlier
discussion. Is there any chance you can provide a pointer to it? A
Google Groups search for "void main" is unlikely to be useful.
<uberpedant>
you too are incorrect since you need to add the words "provided it
documents the alternate form".
</>
My intent was that "allowing" it includes the requirement to document
it, but I was insufficiently clear on that point. In any case, 'void
main(void)', even for an implementation that doesn't explicitly
support it, merely invokes undefined behavior; it's not a constraint
violation, so no diagnostic is required. If the implementation
documents the behavior of 'void main(void)', it's a valid extension
(and it must actually work as the standard and the implementation's
documentation specify). If the implementation doesn't document it, it
can treat it in any random way it likes; that includes behaving in
accordance with the documentation that would have been provided if
that page hadn't fallen out of the manual.
If I had inserted the word "portable" somewhere there, would that have
satisfied by the way?
It would depend on where and how you insert it, but yes, it probably
would.
See my response elsethread, which you've either ignored, or missed.
I've read the entire thread. Google Groups says you've posted nine
responses in this thread; I don't know which one you're referring to.
I also want to point out that the uber-pedantry with which this point
has been debated has almost certainly given some newbies the mistaken
impression that void main() is generally ok. I trust those of you who
leapt upon this particular hobbyhorse feel happy with that.
I believe I've made it clear, in most of the responses I've posted on
this thread, that 'void main(void)' is non-portable and that there's
no reason to use it in a hosted environment.
Kids, don't use 'void main(void)'! main() returns int!
(In a freestanding environment, 'void main(void)' could be the *only*
supported form, but newbies are unlikely to encounter freestanding
environments.)
For the record, I'd be happier if the "or in some other
implementation-defined manner" wording had never been added to the
standard. I think it was intended primarily to allow the fairly
common extension of a 'char **envp' parameter, but it would be better
to allow that only in a non-conforming mode. I would also prefer
forms of main() other than the allowed ones to be constraint
violations rather than undefined behavior, so programming errors could
be caught earlier. In other words, I *wish* your statement were
correct.
For that matter, the "or in some other implementation-defined manner"
wording is redundant, since extensions are explicitly allowed anyway
(C99 4p6).
But as I wrote above, I can only base my arguments on what the
standard actually says.