From 7a208f2e4560c1b71721e3a7fcc4be08c23ad2d1 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Wed, 8 May 2024 13:49:37 +0200 Subject: [PATCH v1 6/7] XXX Fix -Wmissing-variable-declarations warnings for GUC variables Add extern declarations for global variables related to GUC. XXX These should probably all be in header files. --- src/backend/access/rmgrdesc/xlogdesc.c | 1 + src/backend/access/transam/xlog.c | 5 +++++ src/backend/access/transam/xlogrecovery.c | 1 + src/backend/access/transam/xlogutils.c | 1 + src/backend/commands/tablespace.c | 4 ++++ src/backend/storage/ipc/dsm_impl.c | 1 + src/backend/storage/page/bufpage.c | 1 + src/backend/tcop/backend_startup.c | 1 + src/backend/tcop/postgres.c | 1 + src/backend/utils/misc/guc_tables.c | 3 +++ 10 files changed, 19 insertions(+) diff --git a/src/backend/access/rmgrdesc/xlogdesc.c b/src/backend/access/rmgrdesc/xlogdesc.c index e455400716d..f28f1062032 100644 --- a/src/backend/access/rmgrdesc/xlogdesc.c +++ b/src/backend/access/rmgrdesc/xlogdesc.c @@ -24,6 +24,7 @@ /* * GUC support */ +extern const struct config_enum_entry wal_level_options[]; const struct config_enum_entry wal_level_options[] = { {"minimal", WAL_LEVEL_MINIMAL, false}, {"replica", WAL_LEVEL_REPLICA, false}, diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index c3fd9c1eaed..5ed28add809 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -110,6 +110,9 @@ extern uint32 bootstrap_data_checksum_version; /* timeline ID to be used when bootstrapping */ #define BootstrapTimeLineID 1 +extern int CommitDelay; +extern int CommitSiblings; + /* User-settable parameters */ int max_wal_size_mb = 1024; /* 1 GB */ int min_wal_size_mb = 80; /* 80 MB */ @@ -168,6 +171,7 @@ static bool check_wal_consistency_checking_deferred = false; /* * GUC support */ +extern const struct config_enum_entry wal_sync_method_options[]; const struct config_enum_entry wal_sync_method_options[] = { {"fsync", WAL_SYNC_METHOD_FSYNC, false}, #ifdef HAVE_FSYNC_WRITETHROUGH @@ -188,6 +192,7 @@ const struct config_enum_entry wal_sync_method_options[] = { * Although only "on", "off", and "always" are documented, * we accept all the likely variants of "on" and "off". */ +extern const struct config_enum_entry archive_mode_options[]; const struct config_enum_entry archive_mode_options[] = { {"always", ARCHIVE_MODE_ALWAYS, false}, {"on", ARCHIVE_MODE_ON, false}, diff --git a/src/backend/access/transam/xlogrecovery.c b/src/backend/access/transam/xlogrecovery.c index 29c5bec0847..ed884ab6637 100644 --- a/src/backend/access/transam/xlogrecovery.c +++ b/src/backend/access/transam/xlogrecovery.c @@ -71,6 +71,7 @@ /* * GUC support */ +extern const struct config_enum_entry recovery_target_action_options[]; const struct config_enum_entry recovery_target_action_options[] = { {"pause", RECOVERY_TARGET_ACTION_PAUSE, false}, {"promote", RECOVERY_TARGET_ACTION_PROMOTE, false}, diff --git a/src/backend/access/transam/xlogutils.c b/src/backend/access/transam/xlogutils.c index 5295b85fe07..053a25429f6 100644 --- a/src/backend/access/transam/xlogutils.c +++ b/src/backend/access/transam/xlogutils.c @@ -31,6 +31,7 @@ /* GUC variable */ +extern bool ignore_invalid_pages; bool ignore_invalid_pages = false; /* diff --git a/src/backend/commands/tablespace.c b/src/backend/commands/tablespace.c index 113b4807315..37c7252e86c 100644 --- a/src/backend/commands/tablespace.c +++ b/src/backend/commands/tablespace.c @@ -80,6 +80,10 @@ #include "utils/varlena.h" /* GUC variables */ +extern char *default_tablespace; +extern char *temp_tablespaces; +extern bool allow_in_place_tablespaces; + char *default_tablespace = NULL; char *temp_tablespaces = NULL; bool allow_in_place_tablespaces = false; diff --git a/src/backend/storage/ipc/dsm_impl.c b/src/backend/storage/ipc/dsm_impl.c index 8dd669e0ce9..04945bb3e84 100644 --- a/src/backend/storage/ipc/dsm_impl.c +++ b/src/backend/storage/ipc/dsm_impl.c @@ -92,6 +92,7 @@ static bool dsm_impl_mmap(dsm_op op, dsm_handle handle, Size request_size, #endif static int errcode_for_dynamic_shared_memory(void); +extern const struct config_enum_entry dynamic_shared_memory_options[]; const struct config_enum_entry dynamic_shared_memory_options[] = { #ifdef USE_DSM_POSIX {"posix", DSM_IMPL_POSIX, false}, diff --git a/src/backend/storage/page/bufpage.c b/src/backend/storage/page/bufpage.c index be6f1f62d29..58836629a09 100644 --- a/src/backend/storage/page/bufpage.c +++ b/src/backend/storage/page/bufpage.c @@ -24,6 +24,7 @@ /* GUC variable */ +extern bool ignore_checksum_failure; bool ignore_checksum_failure = false; diff --git a/src/backend/tcop/backend_startup.c b/src/backend/tcop/backend_startup.c index ee73d01e16c..e032a17e7ae 100644 --- a/src/backend/tcop/backend_startup.c +++ b/src/backend/tcop/backend_startup.c @@ -38,6 +38,7 @@ #include "utils/timeout.h" /* GUCs */ +extern bool Trace_connection_negotiation; bool Trace_connection_negotiation = false; static void BackendInitialize(ClientSocket *client_sock, CAC_state cac); diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index 2dff28afcef..60797c9b6cd 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -90,6 +90,7 @@ const char *debug_query_string; /* client-supplied query string */ CommandDest whereToSendOutput = DestDebug; /* flag for logging end of session */ +extern bool Log_disconnections; bool Log_disconnections = false; int log_statement = LOGSTMT_NONE; diff --git a/src/backend/utils/misc/guc_tables.c b/src/backend/utils/misc/guc_tables.c index 0729db4b3b6..d8e66782976 100644 --- a/src/backend/utils/misc/guc_tables.c +++ b/src/backend/utils/misc/guc_tables.c @@ -509,6 +509,7 @@ bool log_executor_stats = false; bool log_statement_stats = false; /* this is sort of all three above * together */ bool log_btree_build_stats = false; +extern char *event_source; char *event_source; bool row_security; @@ -618,9 +619,11 @@ static char *recovery_target_name_string; static char *recovery_target_lsn_string; /* should be static, but commands/variable.c needs to get at this */ +extern char *role_string; char *role_string; /* should be static, but guc.c needs to get at this */ +extern bool in_hot_standby_guc; bool in_hot_standby_guc; -- 2.44.0