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

Поиск
Список
Период
Сортировка
От Kyotaro Horiguchi
Тема Re: add non-option reordering to in-tree getopt_long
Дата
Msg-id 20230613.160201.833376179512503274.horikyota.ntt@gmail.com
обсуждение исходный текст
Ответ на Re: add non-option reordering to in-tree getopt_long  (Nathan Bossart <nathandbossart@gmail.com>)
Ответы Re: add non-option reordering to in-tree getopt_long  (Nathan Bossart <nathandbossart@gmail.com>)
Список pgsql-hackers
At Mon, 12 Jun 2023 22:13:43 -0700, Nathan Bossart <nathandbossart@gmail.com> wrote in 
> On Tue, Jun 13, 2023 at 12:00:01PM +0900, Kyotaro Horiguchi wrote:
> > POSIXLY_CORRECT appears to be intended for debugging or feature
> > validation. If we know we can always rearrange argv on those
> > platforms, we don't need it.  I would suggest that we turn on the new
> > feature at the compile time on those platforms where we know this
> > rearrangement works, instead of switching at runtime.
> 
> I'd be okay with leaving it out wherever possible.  I'm curious whether any
> supported systems do not allow this.

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.

> > 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..)

regards.

-- 
Kyotaro Horiguchi
NTT Open Source Software Center



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

Предыдущее
От: Gurjeet Singh
Дата:
Сообщение: Re: Document that server will start even if it's unable to open some TCP/IP ports
Следующее
От: Kyotaro Horiguchi
Дата:
Сообщение: Re: Avoid unncessary always true test (src/backend/storage/buffer/bufmgr.c)