Add some noreturn attributes based on compiler recommendations
authorPeter Eisentraut <peter_e@gmx.net>
Thu, 14 Aug 2014 02:40:48 +0000 (22:40 -0400)
committerPeter Eisentraut <peter_e@gmx.net>
Thu, 14 Aug 2014 02:40:48 +0000 (22:40 -0400)
contrib/test_shm_mq/test_shm_mq.h
contrib/worker_spi/worker_spi.c
src/include/bootstrap/bootstrap.h
src/include/parser/scanner.h
src/include/postmaster/bgworker_internals.h

index 7ebfba902f91cdfd98774ac8fc405e9d27adc7c9..04a7931fa948c6b981dab415833c22d160c6149b 100644 (file)
@@ -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
index 829de0e6a7f3db852ac6c45488803847f4d7d99d..328c722c35932f4d55a6d72fa950ead6359fe8b0 100644 (file)
@@ -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;
index 24ad93dbe97ac0246ff05b2c428a781f8a07f6a5..4d954eb28eeeefdae8c9db982a6b9463865fa3ac 100644 (file)
@@ -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 */
index 1f2d185234e13ed00256b292bc222840d811cf6f..008d93f9af7eb76dd5523965e4344b88ea4abc24 100644 (file)
@@ -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 */
index c2518a6c8d7c32da8bb033e190ba522ffa13e931..6a69a5b52292c0a5e096ea5340fa415ec850702a 100644 (file)
@@ -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);