Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rFdDI-00B3hL-Td for pgsql-hackers@arkaria.postgresql.org; Tue, 19 Dec 2023 16:45:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rFdDH-003IbE-Ca for pgsql-hackers@arkaria.postgresql.org; Tue, 19 Dec 2023 16:44:59 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rFdDH-003IZz-2K for pgsql-hackers@lists.postgresql.org; Tue, 19 Dec 2023 16:44:59 +0000 Received: from mail-io1-xd33.google.com ([2607:f8b0:4864:20::d33]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rFdDE-00CpBe-DV for pgsql-hackers@postgresql.org; Tue, 19 Dec 2023 16:44:58 +0000 Received: by mail-io1-xd33.google.com with SMTP id ca18e2360f4ac-7b7f93eb935so19191339f.1 for ; Tue, 19 Dec 2023 08:44:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703004294; x=1703609094; darn=postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=IHOvXHaaAgfEtfPSWAECuZTOD41FJMVoGe9NgPTeylo=; b=gSjIHomFBk+Z4TXqekugIOTkGxf3n0bUzGZ3JX71UK4/Ti6WOkO2HLomgNsSTlE/oo onMw7c61x1tQCFjnSSpVz0oPkPaMInt2a3g0xzJQVtZyFdi+5ec4Woh/f1JNKq00EzH6 +Yx6U4gGwq1+uN6MrrPixAdkPciZzD5aeMwqCUXGSnZ+aKCCJWpow3ygJZlwWWyyFvlV 9egMl1mRIx3tG8qq9osDNsb+RZvdB5a5tIA+kMFd2m3jlhGf4HCy6vMq+D1goJ0w/6IO 2uknrjpB4wYr9FkpRuobyzxQmhgCqhvapOVKv4eQsLzc7l8p1MHFkB8e3/ixYMFz3JGv scNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703004294; x=1703609094; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=IHOvXHaaAgfEtfPSWAECuZTOD41FJMVoGe9NgPTeylo=; b=o5ey5VihowhND9Jo2/u/8z33PJgVhfr1J2ExsDzJJgPoxj0iKpuas7+2fefUkjvHCC zCyfmEzNvCyURIBo0igLXOAscjMHaOA2NrfVk8BC5ISgnYeR/8/igtp4sTb/Bzt6kyGN x0+RlBPFt1g8B/OTVAfirCdpC9VvKbVmHNOR/+4FfjFx/j5ck45NW0p3Ak8CUbYhf8Rp b+6NT/jlvfpIH7yVO5DPY/QjaCgxBzAze5HwkuGUhYa6kzVkzo6pwlcdhM9cUPIyhlra wK3D8+Ms5ad5fEtm1aPqkq7D5kj18t0PDT5u/63F5LkBLgbIN07o7FDr/Cwhq+CGfVox +bkw== X-Gm-Message-State: AOJu0YyCnF+JAenurjMB7m4Bmj0YpshyZ6iQq9KAOF6lufm7R3jFP3vt il5mnQ7p9R3w9wfwCA2r7Q4= X-Google-Smtp-Source: AGHT+IHy7h01QM1EMhSnZ0ygwrk/vrvOT+kSEZtGOmNJMrhiTGWcXQV/8sK2wnqKMsybdt6gpYyi6Q== X-Received: by 2002:a6b:5b0d:0:b0:7b7:90cb:6ef7 with SMTP id v13-20020a6b5b0d000000b007b790cb6ef7mr12320186ioh.38.1703004294338; Tue, 19 Dec 2023 08:44:54 -0800 (PST) Received: from nathanxps13 (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id ei11-20020a05663829ab00b0041e328a2084sm661411jab.79.2023.12.19.08.44.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 08:44:53 -0800 (PST) Date: Tue, 19 Dec 2023 10:44:52 -0600 From: Nathan Bossart To: Tom Lane Cc: Michael Paquier , Kyotaro Horiguchi , noah@leadboat.com, pgsql-hackers@postgresql.org Subject: Re: add non-option reordering to in-tree getopt_long Message-ID: <20231219164452.GA832556@nathanxps13> References: <20230711163232.GA616878@nathanxps13> <20230713034903.GA991765@nathanxps13> <20230713145712.GA1049722@nathanxps13> <20230714043842.GB327716@nathanxps13> <4007895.1702928482@sss.pgh.pa.us> <20231218215201.GA586573@nathanxps13> <4139302.1702953114@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4139302.1702953114@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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