From d98db89470c00de2a64e851c6a7baa8aecc19d4a Mon Sep 17 00:00:00 2001 From: Aurelien 'beorn' Rougemont Date: Fri, 12 Jun 2020 01:29:08 +0200 Subject: [PATCH] Global CONFIG_FILE variable defined without extern in header file Since GCC 10.1.0 (2020-05-07) default compilation options to use -fno-common, which means that by default, the code above no longer links unless you override the default with -fcommon --- src/umonitor.c | 2 ++ src/umonitor.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/umonitor.c b/src/umonitor.c index f906166..dc4b0dc 100644 --- a/src/umonitor.c +++ b/src/umonitor.c @@ -93,6 +93,8 @@ static const struct option long_options[] = { {"force-load", no_argument, &force_load, 1} }; +/* Definition checked against declaration in umonitor.h */ +char* CONFIG_FILE; void umon_print(const char *format, ...) { diff --git a/src/umonitor.h b/src/umonitor.h index 64db109..f4d13a2 100644 --- a/src/umonitor.h +++ b/src/umonitor.h @@ -1,5 +1,5 @@ // Global variables -char *CONFIG_FILE; /*!< Configuration file path name */ +extern char *CONFIG_FILE; /*!< Configuration file path name */ // Some helper functions void fetch_edid(xcb_randr_output_t * output_p, screen_class * screen_t_p,