From d31094f0ab5df9504847c7c0f4085f86b417321c Mon Sep 17 00:00:00 2001 From: Steve Singer Date: Sat, 23 May 2020 20:35:03 -0400 Subject: [PATCH] move variable declarations to the .c file headers should only include extern declarations. Add -fno-common to the default compiler options. This is now standard with GCC 10+ compilers with -fno-common will error out on the duplicate definitions. --- Makefile.global.in | 2 +- src/slon/confoptions.c | 12 +++++++++++- src/slon/confoptions.h | 12 +----------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Makefile.global.in b/Makefile.global.in index 71d13180..bd220247 100644 --- a/Makefile.global.in +++ b/Makefile.global.in @@ -92,7 +92,7 @@ subdir=$(slony_subdir) LDFLAGS += -lpq @NLSLIB@ ifeq ($(GCC), yes) - CFLAGS += -Wall -Wmissing-prototypes -Wmissing-declarations + CFLAGS += -Wall -Wmissing-prototypes -Wmissing-declarations -fno-common endif # Installation. diff --git a/src/slon/confoptions.c b/src/slon/confoptions.c index 4eb6b855..bf3ccc87 100644 --- a/src/slon/confoptions.c +++ b/src/slon/confoptions.c @@ -24,7 +24,17 @@ static double real_placeholder; void dump_configuration(void); void build_conf_variables(void); - +char *Syslog_ident; +char *Syslog_facility; +int Use_syslog; + +bool logpid; +bool logtimestamp; +bool drop_indices; +char *log_timestamp_format; +char *sql_on_connection; +char *lag_interval; +char *command_on_logarchive; static struct config_int ConfigureNamesInt[] = { diff --git a/src/slon/confoptions.h b/src/slon/confoptions.h index 63c5c8f4..e20d0600 100644 --- a/src/slon/confoptions.h +++ b/src/slon/confoptions.h @@ -43,18 +43,8 @@ extern int apply_cache_size; extern int vac_frequency; extern char *cleanup_interval; -char *Syslog_ident; -char *Syslog_facility; -int Use_syslog; - -bool logpid; -bool logtimestamp; -bool drop_indices; -char *log_timestamp_format; -char *sql_on_connection; -char *lag_interval; -char *command_on_logarchive; +extern char *command_on_logarchive; enum config_type { SLON_C_BOOL, -- 2.39.5