mirror of
https://github.com/postgres/postgres.git
synced 2025-08-31 17:02:12 +03:00
Tweak __attribute__-wrapping macros for better pgindent results.
This improves on commit bbfd7edae5
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.
This commit is contained in:
@@ -64,7 +64,7 @@ typedef void (*shmem_startup_hook_type) (void);
|
||||
/* ipc.c */
|
||||
extern PGDLLIMPORT bool proc_exit_inprogress;
|
||||
|
||||
extern void proc_exit(int code) pg_attribute_noreturn;
|
||||
extern void proc_exit(int code) pg_attribute_noreturn();
|
||||
extern void shmem_exit(int code);
|
||||
extern void on_proc_exit(pg_on_exit_callback function, Datum arg);
|
||||
extern void on_shmem_exit(pg_on_exit_callback function, Datum arg);
|
||||
|
@@ -41,7 +41,7 @@ typedef struct ItemPointerData
|
||||
}
|
||||
|
||||
#ifdef __arm__
|
||||
pg_attribute_packed /* Appropriate whack upside the head for ARM */
|
||||
pg_attribute_packed() /* Appropriate whack upside the head for ARM */
|
||||
#endif
|
||||
ItemPointerData;
|
||||
|
||||
|
@@ -547,7 +547,7 @@ extern void lock_twophase_standby_recover(TransactionId xid, uint16 info,
|
||||
|
||||
extern DeadLockState DeadLockCheck(PGPROC *proc);
|
||||
extern PGPROC *GetBlockingAutoVacuumPgproc(void);
|
||||
extern void DeadLockReport(void) pg_attribute_noreturn;
|
||||
extern void DeadLockReport(void) pg_attribute_noreturn();
|
||||
extern void RememberSimpleDeadLock(PGPROC *proc1,
|
||||
LOCKMODE lockmode,
|
||||
LOCK *lock,
|
||||
|
Reference in New Issue
Block a user