C++ Logo

std-proposals

Advanced search

Re: [std-proposals] D3803R0 More standard forms of main

From: Brian Bi <bbi5291_at_[hidden]>
Date: Tue, 22 Jul 2025 12:33:38 -0400
On Tue, Jul 22, 2025 at 12:24 PM Paul Caprioli via Std-Proposals <
std-proposals_at_[hidden]> wrote:

>
> > The one interesting question in the proposal is whether "void main()"
> should be permitted.
>
> I would suggest it is better not to standardize "void main()".
> As you pointed out, it only adds complexity since "int main()" still has
> to be taught.
> Also, "void main()" is still magical, perhaps more so, because it returns
> EXIT_SUCCESS.
>

I don't think we have to teach people that `void main()` "returns
`EXIT_SUCCESS`". Observing the return code of `main` is not a beginner
topic.


> Finally, it must be taught that it is unconventional and not supported by
> older compilers.
>

"not supported by older compilers" could be raised as an argument against
literally any new feature.


> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>


-- 
*Brian Bi*

Received on 2025-07-22 16:33:56