Date: Tue, 22 Jul 2025 20:36:09 +0300
On Tue, 22 Jul 2025 at 13:41, Jan Schultke via Std-Proposals
<std-proposals_at_[hidden]> wrote:
>
> Hi,
>
> I'm cooking up a draft for a proposal:
> https://gist.github.com/Eisenwave/78d6127b73c6c9a1bc4cb55ad7bf249c
>
> In short, the goal is for "int main(int, const char**)" and some other
> signatures to be permitted. Many C++ developers probably expect this
> to be standard C++ already, but surprisingly, this is voluntarily
> supported by implementations despite there being no such requirement.
> This borders on being a CWG issue, but I don't think CWG could make
> such a decision without consulting EWG anyway, so here we are.
>
> The one interesting question in the proposal is whether "void main()"
> should be permitted. I think there are some good arguments in favor of
> that, but also good arguments against.
>
> Let me know what you think :)
Considering that
1) a large portion of main functions are wizard-generated
2) quite many of them just pass argc/argv to a framework object, and
for quite many cases, that's
also wizard-generated and argc/argv aren't used by anything else
3) there's quite a bit of C++ code that's just plugins combined with
an existing application written in something else, but sometimes in
C++,
and for the plentiful amount of "written in something else", there is
no C++ main
the bang for the buck isn't there, and this sort of small tweaks to
const-correctness of argv and the return type of main are not a good
use of the committee time.
<std-proposals_at_[hidden]> wrote:
>
> Hi,
>
> I'm cooking up a draft for a proposal:
> https://gist.github.com/Eisenwave/78d6127b73c6c9a1bc4cb55ad7bf249c
>
> In short, the goal is for "int main(int, const char**)" and some other
> signatures to be permitted. Many C++ developers probably expect this
> to be standard C++ already, but surprisingly, this is voluntarily
> supported by implementations despite there being no such requirement.
> This borders on being a CWG issue, but I don't think CWG could make
> such a decision without consulting EWG anyway, so here we are.
>
> The one interesting question in the proposal is whether "void main()"
> should be permitted. I think there are some good arguments in favor of
> that, but also good arguments against.
>
> Let me know what you think :)
Considering that
1) a large portion of main functions are wizard-generated
2) quite many of them just pass argc/argv to a framework object, and
for quite many cases, that's
also wizard-generated and argc/argv aren't used by anything else
3) there's quite a bit of C++ code that's just plugins combined with
an existing application written in something else, but sometimes in
C++,
and for the plentiful amount of "written in something else", there is
no C++ main
the bang for the buck isn't there, and this sort of small tweaks to
const-correctness of argv and the return type of main are not a good
use of the committee time.
Received on 2025-07-22 17:36:24