C++ Logo

std-proposals

Advanced search

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

From: Andre Kostur <andre_at_[hidden]>
Date: Tue, 22 Jul 2025 09:22:10 -0700
Nit in the proposal. Marking main (or any function) as noexcept does not
express that no exceptions may reach main (or whatever function). It only
expresses that no exceptions may escape.

On Tue, Jul 22, 2025 at 8:56 AM Tiago Freire via Std-Proposals <
std-proposals_at_[hidden]> wrote:

> It feels like "void main()" is the "always implementable" version of it.
> Only requirement being the ability to create a function in the language
> with this signature and be able to call it.
>
> Any other signature lives in the magical realm of "whatever the OS around
> it is doing". Which I feel is a discussion about matters outside of the C++
> standard.
>
>
>
>
>
>
> ------------------------------
> *From:* Std-Proposals <std-proposals-bounces_at_[hidden]> on behalf
> of Jan Schultke via Std-Proposals <std-proposals_at_[hidden]>
> *Sent:* Tuesday, July 22, 2025 11:41:14 AM
> *To:* C++ Proposals <std-proposals_at_[hidden]>
> *Cc:* Jan Schultke <janschultke_at_[hidden]>
> *Subject:* [std-proposals] D3803R0 More standard forms of main
>
> 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 :)
>
>
> Jan
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>

Received on 2025-07-22 16:22:26