Re: typedef indentation in pg_shmem.h

From: Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Subject: Re: typedef indentation in pg_shmem.h
Date: 2026-01-12 15:36:55
Message-ID: CAExHW5saWx9MmkB5AmjsiodeKX2shDwmRvPSb7xMZ=tbwZcvhA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Tom,

On Mon, Jan 12, 2026 at 8:32 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com> writes:
> > The typedefs PGShmemType and HugePagesType are not indented properly.
> > That's because those entries are missing from typedefs list. Is that
> > intentional?
>
> The reason this happens is that the automatic process for collecting
> typedefs in the buildfarm only picks up typedef names that are used
> to declare objects (variables, struct fields, function parameters or
> results).
>
> AFAICS neither of these typedef names are referenced at all, anywhere.
>
> > Here's tiny patch fixing the indentation and typedefs
> > list.
>
> I don't think this is helpful, because that change will just get
> undone the next time we absorb the buildfarm's list. (And to be
> clear, I consider the buildfarm's list to be the canonical one.)
>
> I think the right way is to remove the unused typedefs, that is
> along the lines of
>
> -typedef enum
> +enum HugePagesType
> {
> ...
> -} HugePagesType;
> +};
>
> We can put them back when/if there's a reason to use them.

Thanks for your corrections. Your idea works, the changes survive
pgindent run. PFA patch.

--
Best Wishes,
Ashutosh Bapat

Attachment Content-Type Size
v20260112-0001-Fix-PGShmemType-and-HugePagesType-typedefs.patch text/x-patch 1.7 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2026-01-12 15:44:19 Re: Don't cast away const where possible
Previous Message Greg Sabino Mullane 2026-01-12 15:23:11 Re: ALTER TABLE: warn when actions do not recurse to partitions