C++ Logo

std-proposals

Advanced search

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

From: Thiago Macieira <thiago_at_[hidden]>
Date: Wed, 23 Jul 2025 07:55:29 -0700
On Wednesday, 23 July 2025 05:29:15 Pacific Daylight Time Simon Schröder via
Std-Proposals wrote:
> It might still be interesting
> to have the envp parameter to know the initial state of environment
> variables (should be const then).

Again, like argv, the envp is modifiable. That's actually how setenv() and
putenv() works if you modify an existing variable to a value shorter than
what's already there. However, I'll agree this is a very niche use-case, even
more so than modifying what ps(1) shows (though ps can show the environment
too).

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

Received on 2025-07-23 14:55:35