C++ Logo

sg16

Advanced search

Re: [SG16] A UTF-8 environment specification; an alternative to assuming UTF-8 based on choice of literal encoding

From: Tom Honermann <tom_at_[hidden]>
Date: Fri, 30 Jul 2021 12:31:19 -0400
On 7/30/21 12:22 PM, Thiago Macieira wrote:
> On Friday, 30 July 2021 08:41:13 PDT Tom Honermann wrote:
>> True today, but I suspect their location is subject to change (though
>> probably unlikely).
> It's guaranteed by ABI.
>
>> Is there a straight forward way to determine their location in memory?
> Yes from main, because you got a pointer to argv and nothing can have modified
> them yet.
>
> After main(), even if you get a pointer to them, you can't be sure they
> haven't been modified / clobbered / overwritten, so that's not useful.
>
> On Windows, GetCommandLineW() is always valid.
>
Indeed. My use case was trying to get them before main().

Tom.

Received on 2021-07-30 11:31:21