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

From Tom Lane
Subject Re: pgsql: Move the server's backup manifest code to a separate file.
Date
Msg-id 27239.1587415696@sss.pgh.pa.us
Whole thread Raw
In response to pgsql: Move the server's backup manifest code to a separate file.  (Robert Haas <rhaas@postgresql.org>)
List pgsql-committers
Robert Haas <rhaas@postgresql.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



pgsql-committers by date:

Previous
From: Robert Haas
Date:
Subject: pgsql: Move the server's backup manifest code to a separate file.
Next
From: Tom Lane
Date:
Subject: pgsql: Doc: update sections 9.7 and 9.8 for new function table layout.