Date: Fri, 30 Jul 2021 09:22:43 -0700
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.
> 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.
-- Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org Software Architect - Intel DPG Cloud Engineering
Received on 2021-07-30 11:23:01