Re: pgsql: Move the server's backup manifest code to a separate file.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <rhaas(at)postgresql(dot)org>
Cc: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Move the server's backup manifest code to a separate file.
Date: 2020-04-20 20:48:16
Message-ID: 27239.1587415696@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Robert Haas <rhaas(at)postgresql(dot)org> writes:
> Move the server's backup manifest code to a separate file.

This broke the build for me (with gcc 4.4.7):

In file included from basebackup.c:34:
../../../src/include/replication/backup_manifest.h:36: error: redefinition of typedef 'manifest_info'
../../../src/include/replication/basebackup.h:34: note: previous declaration of 'manifest_info' was here
make[3]: *** [basebackup.o] Error 1

Not really sure why the buildfarm isn't showing the same.
But this in basebackup.h sure looks like an antipattern:

struct manifest_info;
typedef struct manifest_info manifest_info;

The usual thing, if you don't want to actually include the typedef,
is more like

struct manifest_info;
...
extern int64 sendTablespace(char *path, char *oid, bool sizeonly,
struct manifest_info *manifest);

Also a comment along the lines of "avoid including foo.h"
is standard practice.

regards, tom lane

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2020-04-20 22:44:20 pgsql: Doc: update sections 9.7 and 9.8 for new function table layout.
Previous Message Tom Lane 2020-04-20 20:21:32 Re: pgsql: doc: add examples of creative use of unique expression indexes