Re: add non-option reordering to in-tree getopt_long

Поиск
Список
Период
Сортировка
От Nathan Bossart
Тема Re: add non-option reordering to in-tree getopt_long
Дата
Msg-id 20230613223657.GC219055@nathanxps13
обсуждение исходный текст
Ответ на Re: add non-option reordering to in-tree getopt_long  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Ответы Re: add non-option reordering to in-tree getopt_long  (Michael Paquier <michael@paquier.xyz>)
Список pgsql-hackers
On Tue, Jun 13, 2023 at 04:02:01PM +0900, Kyotaro Horiguchi wrote:
> Hmm. from the initial mail, I got the impression that AIX and Windows
> allow this, so I thought that we can do that for them.  While there
> could be other platforms that allow it, perhaps we don't need to go as
> far as extending this until we come across another platform that does.

Windows seems to allow rearranging argv, based upon cfbot's results.  I do
not know about AIX.  In any case, C99 explicitly mentions that argv should
be modifiable.

>> > As far as I can see, getopt_long on Rocky9 does *not* rearrange argv
>> > until it reaches the end of the array. But it won't matter much.
>> 
>> Do you mean that it rearranges argv once all the options have been
>> returned, or that it doesn't rearrange argv at all?
> 
> I meant the former. argv remains unaltered until getopt_long returns
> -1. Once it does, non-optional arguments are being collected at the
> end of argv.  (But in my opinion, that behavior isn't very significant
> in this context..)

Got it.

-- 
Nathan Bossart
Amazon Web Services: https://aws.amazon.com



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: ERROR: wrong varnullingrels (b 3) (expected (b)) for Var 2/1
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: allow granting CLUSTER, REFRESH MATERIALIZED VIEW, and REINDEX