Re: seemingly useless #include recently added

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: seemingly useless #include recently added
Date: 2023-04-25 03:41:06
Message-ID: CA+hUKGKSqK3FdgDVPutMmftq4nN8OTHKumhV1DYbKDU4YzUx6A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Apr 25, 2023 at 3:12 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com> writes:
> > While working on a patch, I noticed that a rcent commit (d4e71df6d75)
> > added an apparently unnecessary inclusion of guc.h in smgr.h.
>
> Yes, that seems quite awful, and I also wonder why it changed fd.h.
> Adding #include's to header files is generally not the first choice.

Agreed for smgr.h. Will push when I'm back at a real computer soon,
or +1 from me if someone else wants to. It must have been left over
from an earlier version that had a different arrangement with multiple
GUCs in different places and might have needed GUC-related types to
declare the check functions or something like that; sorry. As for
fd.h, the reason it now includes <fcntl.h> is that fd.h tests whether
O_DIRECT is defined, so in fact that was an omission from 2dbe8905
which moved the #if defined(O_DIRECT) stuff from xlogdefs.h to fd.h
but failed to move the #include with it; I will check if something
needs to be back-patched there.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Zhijie Hou (Fujitsu) 2023-04-25 03:57:59 RE: Support logical replication of DDLs
Previous Message Tom Lane 2023-04-25 03:12:05 Re: seemingly useless #include recently added