C++ Logo

std-proposals

Advanced search

Re: [std-proposals] A draft for a std::arguments proposal

From: Thiago Macieira <thiago_at_[hidden]>
Date: Tue, 08 Oct 2024 10:31:21 -0700
On Monday 7 October 2024 22:04:22 GMT-7 Jeremy Rifkin via Std-Proposals wrote:
> /proc/self/cmdline might indeed be sufficient to solve a lot of problems
> with arguments being edited in main. My main concern would be more niche
> operating systems that might not have a mechanism like this or
> GetCommandLineW or what OSX provides. I can do some more research later.

Just make it a requirement that the compilers insert special code into main()
to save the two parameters in a global variable.

C++ requires that main() be in C++ and it's illegal to call main() or take its
address.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Principal Engineer - Intel DCAI Platform & System Engineering

Received on 2024-10-08 17:31:28