C++ Logo

std-proposals

Advanced search

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

From: Ville Voutilainen <ville.voutilainen_at_[hidden]>
Date: Tue, 22 Jul 2025 22:14:12 +0300
On Tue, 22 Jul 2025 at 20:50, Jan Schultke <janschultke_at_[hidden]> wrote:
>
> > 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.
>
> How would you feel about it if the proposal also included
> standardization of a third "char** envp" parameter, which every
> implementation already supports?
>
> Would that sufficiently broaden the scope of the proposal to be worth
> committee time?

That would make me less convinced, since that is not in my experience
the way we usually access the environment.

I was never a big fan of standardizing existing practice just because
it's existing practice, and perhaps not considering whether
it's in wide enough use that standardizing it is beneficial. All these
proposed tweaks to parameters of main are like that, they are just
one way to configure your code, and many of us are increasingly not
using it, not on Windows/Linux/Mac desktops or servers,
not on mobile platforms, not on embedded devices. There's a vast
amount of C++ programmers to whom using the parameters
of main is rare as unicorns, and improvements thereof are irrelevant.
For a good portion of the rest, they are already using
some third-party solution, and standardizing the 15th way (or just
some very low-level building blocks) to do it is not going to be an
improvement.

Received on 2025-07-22 19:14:26