Re: Ordering of header file inclusion

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: vignesh C <vignesh21(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Ordering of header file inclusion
Date: 2019-10-23 04:53:05
Message-ID: CAA4eK1KZzBBCpxmk+wL9ZbCtVYqECfVrUUcMtYR0KuKxfVa5vw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Oct 22, 2019 at 3:41 PM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
>
> On Tue, Oct 22, 2019 at 12:56 PM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
> >
> > On Mon, Oct 21, 2019 at 11:04 PM vignesh C <vignesh21(at)gmail(dot)com> wrote:
> > >
> > > On Mon, Oct 21, 2019 at 8:47 AM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
>
> This patch series has broadly changed the code to organize the header
> includes in alphabetic order. It also makes sure that all files first
> includes 'postgres.h'/'postgres_fe.h', system header includes and then
> Postgres header includes.
>
> It also has a change where it seems that for local header includes, we
> have used '<>' whereas quotes ("") should have been used. See,
> ecpg/compatlib/informix.c.
>
> I am planning to commit this as multiple commits (a. contrib modules,
> b. non-backend changes and c. backend changes) as there is some risk
> of buildfarm break. From my side, I will ensure that everything is
> passing on windows and centos. Any objections to this plan?
>

Attached are patches for (a) and (b) after another round of review and
fixes by Vignesh. I am planning to commit the first one (a) tomorrow
morning and then if everything is fine on buildfarm, I will commit the
second one (b) and once both are good, I will look into the third one
(c). Another pair of eyes on these patches would be good.

Just to be clear, the basic rule we follow here is to always first
include 'postgres.h' or 'postgres_fe.h' whichever is applicable, then
system header includes and then Postgres header includes. In this, we
also follow that all the Postgres header includes are in order based
on their ASCII value. We generally follow these rules, but the code
has deviated in many places. These commits make these rules
consistent for the entire code.

--
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

Attachment Content-Type Size
0001-Make-the-order-of-the-header-file-includes-consisten.patch application/octet-stream 43.3 KB
0002-Make-the-order-of-the-header-file-includes-consisten.patch application/octet-stream 60.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2019-10-23 05:13:20 Re: Clean up MinGW def file generation
Previous Message vignesh C 2019-10-23 04:42:32 Re: Ordering of header file inclusion