diff options
| author | Tom Lane | 2015-03-26 18:03:19 +0000 |
|---|---|---|
| committer | Tom Lane | 2015-03-26 18:03:25 +0000 |
| commit | 785941cdc359c6e595201ffb0df9d28f3f7173a4 (patch) | |
| tree | f1cb5a309c53bf1b9112bc51e99c94bfa55f77c7 /src/test/modules | |
| parent | d04c8ed9044eccebce043143a930617e3998c005 (diff) | |
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/test/modules')
| -rw-r--r-- | src/test/modules/test_shm_mq/test_shm_mq.h | 2 | ||||
| -rw-r--r-- | src/test/modules/worker_spi/worker_spi.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/test/modules/test_shm_mq/test_shm_mq.h b/src/test/modules/test_shm_mq/test_shm_mq.h index 94d28805ff5..934df73fe62 100644 --- a/src/test/modules/test_shm_mq/test_shm_mq.h +++ b/src/test/modules/test_shm_mq/test_shm_mq.h @@ -40,6 +40,6 @@ extern void test_shm_mq_setup(int64 queue_size, int32 nworkers, shm_mq_handle **input); /* Main entrypoint for a worker. */ -extern void test_shm_mq_main(Datum) pg_attribute_noreturn; +extern void test_shm_mq_main(Datum) pg_attribute_noreturn(); #endif diff --git a/src/test/modules/worker_spi/worker_spi.c b/src/test/modules/worker_spi/worker_spi.c index 4149c94d302..fcb34ca1983 100644 --- a/src/test/modules/worker_spi/worker_spi.c +++ b/src/test/modules/worker_spi/worker_spi.c @@ -46,7 +46,7 @@ PG_MODULE_MAGIC; PG_FUNCTION_INFO_V1(worker_spi_launch); void _PG_init(void); -void worker_spi_main(Datum) pg_attribute_noreturn; +void worker_spi_main(Datum) pg_attribute_noreturn(); /* flags set by signal handlers */ static volatile sig_atomic_t got_sighup = false; |
