Re: add non-option reordering to in-tree getopt_long - Mailing list pgsql-hackers

From Nathan Bossart
Subject Re: add non-option reordering to in-tree getopt_long
Date
Msg-id 20231219164452.GA832556@nathanxps13
Whole thread Raw
In response to Re: add non-option reordering to in-tree getopt_long  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Mon, Dec 18, 2023 at 09:31:54PM -0500, Tom Lane wrote:
> Agreed, if it actually is 19 years old.  I'm wondering a little bit
> if there could be some moderately-recent glibc behavior change
> involved.  I'm not excited enough about it to go trawl their change
> log, but we should keep our ears cocked for similar reports.

From a brief glance, I believe this is long-standing behavior.  Even though
we advance optind at the bottom of the loop, the next getopt_long() call
seems to reset it to the first non-option (which was saved in a previous
call).

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



pgsql-hackers by date:

Previous
From: Nazir Bilal Yavuz
Date:
Subject: Re: Remove MSVC scripts from the tree
Next
From: Jelte Fennema-Nio
Date:
Subject: Re: Add new for_each macros for iterating over a List that do not require ListCell pointer