Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q8wMn-0004YF-ER for pgsql-hackers@arkaria.postgresql.org; Tue, 13 Jun 2023 05:14:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1q8wLm-0004YF-57 for pgsql-hackers@arkaria.postgresql.org; Tue, 13 Jun 2023 05:13:50 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q8wLl-0004Xe-Qb for pgsql-hackers@lists.postgresql.org; Tue, 13 Jun 2023 05:13:49 +0000 Received: from mail-qv1-xf2c.google.com ([2607:f8b0:4864:20::f2c]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1q8wLj-001ufd-6R for pgsql-hackers@postgresql.org; Tue, 13 Jun 2023 05:13:48 +0000 Received: by mail-qv1-xf2c.google.com with SMTP id 6a1803df08f44-62de0e82a07so5300566d6.1 for ; Mon, 12 Jun 2023 22:13:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686633226; x=1689225226; 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=nmqbZyzzi23EbBf3RfhystKdHUJtfoj3p1MDQ9BwTB4=; b=FNunB3pyOz9RQ18xhPar2FAZWGiP/wKJ9jfm+xZZ5iElrh4k9bubrdmPnp5+h3ad2r lGtmT3O23lSD7TD4tAUht0qALR36N+NVtwe76g+o+WNxTjro5Xes7HRrZ1yiQEIgljUV JnAaKz0R7zSqY6MppeNiOUUol991oTgQjZB0/V+tytQx5Pg2PTmHRjYIq1eRONtXGWRE DH+fNp7725Bdo8j13CR3NLy606qhJEvJIb1syRjA4tu/dc24tn3ZNjtu/iZkzglXTsyU fqSJxqKhNwY2hClKcensUL5xSg4Art+vx7MB58HXCNS4fvTAKmUc1xkIHNCrGVOmBuqS Hdzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686633226; x=1689225226; 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=nmqbZyzzi23EbBf3RfhystKdHUJtfoj3p1MDQ9BwTB4=; b=cPfX3bS7HwDkyp/PbCr3WfYW6oCUFlKlIAPY6pl224x5s0NTohdtFpx+nTI84LTxqT dpP2HajRCfKaXWwbjqX1ygRXlzYtqN1RHKawsgpyVcve32I/gZyWKTGmA8UDHphUSgKZ EtUCawTlzV4qpjEb7/LuqvwOa3qReXtPtYf5zj0+VT+qCk87ifd8tB3L96DtMBRTZXfn FwCu2bjyoih9u+IGaJjQgLXGp1Dt3lleXZQOIN5SCS6mdQ0cvSr6zguhyRpg/kt7MP6H qzJdgurow/xbipEqkuKS88daCRshNOts/RV+DGN/XBq/TXcTBuZ3bWmwOeaYTXCzLEO5 hh4g== X-Gm-Message-State: AC+VfDzfU6NFZRthgAd9hEktnUtA6oXFSeiUHg8e0gqfUROJyKYRGyPb HJ0fyaIg0cktDibbjJH1+yA= X-Google-Smtp-Source: ACHHUZ4eUyD3bwTre51sYmrZbT8tnNFf0iAO+48gHf7im9rmKqWsbaRXbEf51AnsTLGiQGxRxF7oAw== X-Received: by 2002:ad4:5dcf:0:b0:623:6b1a:c5f1 with SMTP id m15-20020ad45dcf000000b006236b1ac5f1mr12666802qvh.4.1686633226241; Mon, 12 Jun 2023 22:13:46 -0700 (PDT) Received: from nathanxps13 ([50.47.162.83]) by smtp.gmail.com with ESMTPSA id s8-20020a62e708000000b0064fd8b3dd13sm7764767pfh.110.2023.06.12.22.13.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 22:13:45 -0700 (PDT) Date: Mon, 12 Jun 2023 22:13:43 -0700 From: Nathan Bossart To: Kyotaro Horiguchi Cc: pgsql-hackers@postgresql.org Subject: Re: add non-option reordering to in-tree getopt_long Message-ID: <20230613051343.GA211254@nathanxps13> References: <20230609232257.GA121461@nathanxps13> <20230613.120001.2091320520660271559.horikyota.ntt@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230613.120001.2091320520660271559.horikyota.ntt@gmail.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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. > 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? -- Nathan Bossart Amazon Web Services: https://aws.amazon.com