On Thu, Dec 23, 2021 at 3:49 PM Amit Kapila <[email protected]> wrote:
>
> On Thu, Dec 23, 2021 at 11:50 AM Amit Kapila <[email protected]> wrote:
> >
> > Move parallel vacuum code to vacuumparallel.c.
> >
>
> There appears to be one failure:
> https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=prairiedog&dt=2021-12-23%2006%3A26%3A03.
>

I could reproduce this error by compiling with '-std=gnu99' on my
machine (macOS):

vacuumparallel.c:198:3: warning: redefinition of typedef
'ParallelVacuumState' is a C11 feature [-Wtypedef-redefinition]
} ParallelVacuumState;
  ^
../../../src/include/commands/vacuum.h:68:36: note: previous definition is here
typedef struct ParallelVacuumState ParallelVacuumState;
                                   ^
1 warning generated.

It seems a C11 feature. The attached patch fixes this issue.

Regards,


--
Masahiko Sawada
EDB:  https://www.enterprisedb.com/
diff --git a/src/backend/commands/vacuumparallel.c b/src/backend/commands/vacuumparallel.c
index 5dd70c5273..8c70efcefa 100644
--- a/src/backend/commands/vacuumparallel.c
+++ b/src/backend/commands/vacuumparallel.c
@@ -138,7 +138,7 @@ typedef struct PVIndStats
 } PVIndStats;
 
 /* Struct for maintaining a parallel vacuum state. */
-typedef struct ParallelVacuumState
+struct ParallelVacuumState
 {
 	/* NULL for worker processes */
 	ParallelContext *pcxt;
@@ -195,7 +195,7 @@ typedef struct ParallelVacuumState
 	char	   *relname;
 	char	   *indname;
 	PVIndVacStatus status;
-} ParallelVacuumState;
+};
 
 static int	parallel_vacuum_compute_workers(Relation *indrels, int nindexes, int nrequested,
 											bool *will_parallel_vacuum);

Reply via email to