diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2015-03-26 14:03:19 -0400 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2015-03-26 14:03:25 -0400 |
| commit | 785941cdc359c6e595201ffb0df9d28f3f7173a4 (patch) | |
| tree | f1cb5a309c53bf1b9112bc51e99c94bfa55f77c7 /src/include/postmaster | |
| parent | d04c8ed9044eccebce043143a930617e3998c005 (diff) | |
| download | postgresql-785941cdc359c6e595201ffb0df9d28f3f7173a4.tar.gz | |
Tweak __attribute__-wrapping macros for better pgindent results.
This improves on commit bbfd7edae5aa5ad5553d3c7e102f2e450d4380d4 by
making two simple changes:
* pg_attribute_noreturn now takes parentheses, ie pg_attribute_noreturn().
Likewise pg_attribute_unused(), pg_attribute_packed(). This reduces
pgindent's tendency to misformat declarations involving them.
* attributes are now always attached to function declarations, not
definitions. Previously some places were taking creative shortcuts,
which were not merely candidates for bad misformatting by pgindent
but often were outright wrong anyway. (It does little good to put a
noreturn annotation where callers can't see it.) In any case, if
we would like to believe that these macros can be used with non-gcc
compilers, we should avoid gratuitous variance in usage patterns.
I also went through and manually improved the formatting of a lot of
declarations, and got rid of excessively repetitive (and now obsolete
anyway) comments informing the reader what pg_attribute_printf is for.
Diffstat (limited to 'src/include/postmaster')
| -rw-r--r-- | src/include/postmaster/autovacuum.h | 4 | ||||
| -rw-r--r-- | src/include/postmaster/bgworker_internals.h | 2 | ||||
| -rw-r--r-- | src/include/postmaster/bgwriter.h | 4 | ||||
| -rw-r--r-- | src/include/postmaster/pgarch.h | 2 | ||||
| -rw-r--r-- | src/include/postmaster/postmaster.h | 4 | ||||
| -rw-r--r-- | src/include/postmaster/startup.h | 2 | ||||
| -rw-r--r-- | src/include/postmaster/syslogger.h | 2 | ||||
| -rw-r--r-- | src/include/postmaster/walwriter.h | 2 |
8 files changed, 11 insertions, 11 deletions
diff --git a/src/include/postmaster/autovacuum.h b/src/include/postmaster/autovacuum.h index 0bd50443ae..6eaaf4c1c4 100644 --- a/src/include/postmaster/autovacuum.h +++ b/src/include/postmaster/autovacuum.h @@ -54,8 +54,8 @@ extern void AutoVacWorkerFailed(void); extern void AutoVacuumUpdateDelay(void); #ifdef EXEC_BACKEND -extern void AutoVacLauncherMain(int argc, char *argv[]) pg_attribute_noreturn; -extern void AutoVacWorkerMain(int argc, char *argv[]) pg_attribute_noreturn; +extern void AutoVacLauncherMain(int argc, char *argv[]) pg_attribute_noreturn(); +extern void AutoVacWorkerMain(int argc, char *argv[]) pg_attribute_noreturn(); extern void AutovacuumWorkerIAm(void); extern void AutovacuumLauncherIAm(void); #endif diff --git a/src/include/postmaster/bgworker_internals.h b/src/include/postmaster/bgworker_internals.h index fe7c328afd..b0ab4c22ba 100644 --- a/src/include/postmaster/bgworker_internals.h +++ b/src/include/postmaster/bgworker_internals.h @@ -46,7 +46,7 @@ extern void BackgroundWorkerStopNotifications(pid_t pid); extern void ResetBackgroundWorkerCrashTimes(void); /* Function to start a background worker, called from postmaster.c */ -extern void StartBackgroundWorker(void) pg_attribute_noreturn; +extern void StartBackgroundWorker(void) pg_attribute_noreturn(); #ifdef EXEC_BACKEND extern BackgroundWorker *BackgroundWorkerEntry(int slotno); diff --git a/src/include/postmaster/bgwriter.h b/src/include/postmaster/bgwriter.h index f584d85787..a49c208dd2 100644 --- a/src/include/postmaster/bgwriter.h +++ b/src/include/postmaster/bgwriter.h @@ -25,8 +25,8 @@ extern int CheckPointTimeout; extern int CheckPointWarning; extern double CheckPointCompletionTarget; -extern void BackgroundWriterMain(void) pg_attribute_noreturn; -extern void CheckpointerMain(void) pg_attribute_noreturn; +extern void BackgroundWriterMain(void) pg_attribute_noreturn(); +extern void CheckpointerMain(void) pg_attribute_noreturn(); extern void RequestCheckpoint(int flags); extern void CheckpointWriteDelay(int flags, double progress); diff --git a/src/include/postmaster/pgarch.h b/src/include/postmaster/pgarch.h index 60e4f50368..9f692eb47f 100644 --- a/src/include/postmaster/pgarch.h +++ b/src/include/postmaster/pgarch.h @@ -33,7 +33,7 @@ extern int pgarch_start(void); #ifdef EXEC_BACKEND -extern void PgArchiverMain(int argc, char *argv[]) pg_attribute_noreturn; +extern void PgArchiverMain(int argc, char *argv[]) pg_attribute_noreturn(); #endif #endif /* _PGARCH_H */ diff --git a/src/include/postmaster/postmaster.h b/src/include/postmaster/postmaster.h index d41761fc7a..d16030482f 100644 --- a/src/include/postmaster/postmaster.h +++ b/src/include/postmaster/postmaster.h @@ -46,7 +46,7 @@ extern int postmaster_alive_fds[2]; extern const char *progname; -extern void PostmasterMain(int argc, char *argv[]) pg_attribute_noreturn; +extern void PostmasterMain(int argc, char *argv[]) pg_attribute_noreturn(); extern void ClosePostmasterPorts(bool am_syslogger); extern int MaxLivePostmasterChildren(void); @@ -56,7 +56,7 @@ extern bool PostmasterMarkPIDForWorkerNotify(int); #ifdef EXEC_BACKEND extern pid_t postmaster_forkexec(int argc, char *argv[]); -extern void SubPostmasterMain(int argc, char *argv[]) pg_attribute_noreturn; +extern void SubPostmasterMain(int argc, char *argv[]) pg_attribute_noreturn(); extern Size ShmemBackendArraySize(void); extern void ShmemBackendArrayAllocation(void); diff --git a/src/include/postmaster/startup.h b/src/include/postmaster/startup.h index 9a2092e5f2..e1fd4b100e 100644 --- a/src/include/postmaster/startup.h +++ b/src/include/postmaster/startup.h @@ -13,7 +13,7 @@ #define _STARTUP_H extern void HandleStartupProcInterrupts(void); -extern void StartupProcessMain(void) pg_attribute_noreturn; +extern void StartupProcessMain(void) pg_attribute_noreturn(); extern void PreRestoreCommand(void); extern void PostRestoreCommand(void); extern bool IsPromoteTriggered(void); diff --git a/src/include/postmaster/syslogger.h b/src/include/postmaster/syslogger.h index d6a05d5a20..dc9f02cd42 100644 --- a/src/include/postmaster/syslogger.h +++ b/src/include/postmaster/syslogger.h @@ -84,7 +84,7 @@ extern int SysLogger_Start(void); extern void write_syslogger_file(const char *buffer, int count, int dest); #ifdef EXEC_BACKEND -extern void SysLoggerMain(int argc, char *argv[]) pg_attribute_noreturn; +extern void SysLoggerMain(int argc, char *argv[]) pg_attribute_noreturn(); #endif #endif /* _SYSLOGGER_H */ diff --git a/src/include/postmaster/walwriter.h b/src/include/postmaster/walwriter.h index 55de6c73e4..1ab7d3d66e 100644 --- a/src/include/postmaster/walwriter.h +++ b/src/include/postmaster/walwriter.h @@ -15,6 +15,6 @@ /* GUC options */ extern int WalWriterDelay; -extern void WalWriterMain(void) pg_attribute_noreturn; +extern void WalWriterMain(void) pg_attribute_noreturn(); #endif /* _WALWRITER_H */ |
