Hi Tom,

On Mon, Jan 12, 2026 at 8:32 PM Tom Lane <[email protected]> wrote:
>
> Ashutosh Bapat <[email protected]> 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
From 8558a47360a31f9d9b10133702b40b1398bdce99 Mon Sep 17 00:00:00 2001
From: Ashutosh Bapat <[email protected]>
Date: Mon, 12 Jan 2026 14:34:01 +0530
Subject: [PATCH v20260112] Fix PGShmemType and HugePagesType typedefs

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). The typedef names mentioned in the subject are
not referenced at all, anywhere. Hence they are not picked up by the buildfarm
process causing their declarations to be wrongly indented. This commit changes
them to plain enums thus avoiding the wrong indentation.

Author: Ashutosh Bapat <[email protected]>
Fix suggested by: Tom Lane <[email protected]>
---
 src/include/storage/pg_shmem.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/include/storage/pg_shmem.h b/src/include/storage/pg_shmem.h
index 3aeada554b2..b1803278542 100644
--- a/src/include/storage/pg_shmem.h
+++ b/src/include/storage/pg_shmem.h
@@ -48,21 +48,21 @@ extern PGDLLIMPORT int huge_page_size;
 extern PGDLLIMPORT int huge_pages_status;
 
 /* Possible values for huge_pages and huge_pages_status */
-typedef enum
+enum HugePagesType
 {
 	HUGE_PAGES_OFF,
 	HUGE_PAGES_ON,
 	HUGE_PAGES_TRY,				/* only for huge_pages */
 	HUGE_PAGES_UNKNOWN,			/* only for huge_pages_status */
-}			HugePagesType;
+};
 
 /* Possible values for shared_memory_type */
-typedef enum
+enum PGShmemType
 {
 	SHMEM_TYPE_WINDOWS,
 	SHMEM_TYPE_SYSV,
 	SHMEM_TYPE_MMAP,
-}			PGShmemType;
+};
 
 #ifndef WIN32
 extern PGDLLIMPORT unsigned long UsedShmemSegID;

base-commit: 707f905399b4e47c295fe247f76fbbe53c737984
-- 
2.34.1

Reply via email to