From: Peter Eisentraut Date: Thu, 14 Aug 2014 02:40:48 +0000 (-0400) Subject: Add some noreturn attributes based on compiler recommendations X-Git-Tag: REL9_5_ALPHA1~1630 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1d678bf7bc66d4478bdee51278946dcc9ae8cae5;p=postgresql Add some noreturn attributes based on compiler recommendations --- diff --git a/contrib/test_shm_mq/test_shm_mq.h b/contrib/test_shm_mq/test_shm_mq.h index 7ebfba902f..04a7931fa9 100644 --- a/contrib/test_shm_mq/test_shm_mq.h +++ b/contrib/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); +extern void test_shm_mq_main(Datum) __attribute__((noreturn)); #endif diff --git a/contrib/worker_spi/worker_spi.c b/contrib/worker_spi/worker_spi.c index 829de0e6a7..328c722c35 100644 --- a/contrib/worker_spi/worker_spi.c +++ b/contrib/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); +void worker_spi_main(Datum) __attribute__((noreturn)); /* flags set by signal handlers */ static volatile sig_atomic_t got_sighup = false; diff --git a/src/include/bootstrap/bootstrap.h b/src/include/bootstrap/bootstrap.h index 24ad93dbe9..4d954eb28e 100644 --- a/src/include/bootstrap/bootstrap.h +++ b/src/include/bootstrap/bootstrap.h @@ -57,6 +57,6 @@ extern void boot_get_type_io_data(Oid typid, extern int boot_yyparse(void); extern int boot_yylex(void); -extern void boot_yyerror(const char *str); +extern void boot_yyerror(const char *str) __attribute__((noreturn)); #endif /* BOOTSTRAP_H */ diff --git a/src/include/parser/scanner.h b/src/include/parser/scanner.h index 1f2d185234..008d93f9af 100644 --- a/src/include/parser/scanner.h +++ b/src/include/parser/scanner.h @@ -114,6 +114,6 @@ extern void scanner_finish(core_yyscan_t yyscanner); extern int core_yylex(core_YYSTYPE *lvalp, YYLTYPE *llocp, core_yyscan_t yyscanner); extern int scanner_errposition(int location, core_yyscan_t yyscanner); -extern void scanner_yyerror(const char *message, core_yyscan_t yyscanner); +extern void scanner_yyerror(const char *message, core_yyscan_t yyscanner) __attribute__((noreturn)); #endif /* SCANNER_H */ diff --git a/src/include/postmaster/bgworker_internals.h b/src/include/postmaster/bgworker_internals.h index c2518a6c8d..6a69a5b522 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); +extern void StartBackgroundWorker(void) __attribute__((noreturn)); #ifdef EXEC_BACKEND extern BackgroundWorker *BackgroundWorkerEntry(int slotno);