Re: unnecessary #include "pg_getopt.h"?

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: torikoshia <torikoshia(at)oss(dot)nttdata(dot)com>, Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: unnecessary #include "pg_getopt.h"?
Date: 2023-05-25 06:59:06
Message-ID: ZG8HOvrycUpz01vr@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, May 23, 2023 at 06:37:59PM -0700, Andres Freund wrote:
> This feels more like a matter of taste to me than anything.

Yup, it is.

> At least some of
> the files touched in the patch use optarg, opterr etc. - which are declared in
> pg_getopt.h. Making it reasonable to directly include pg_getopt.h.

getopt_long.h is included in 21 places of src/bin/, with all of them
touching optarg, while only four of them include pg_getopt.h. So
removing them as suggested makes sense. I agree with the tasting
matter as well, still there is also a consistency matter.
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2023-05-25 07:02:50 Re: running logical replication as the subscription owner
Previous Message Michael Paquier 2023-05-25 06:49:12 Re: ALTER TABLE SET ACCESS METHOD on partitioned tables