Skip to content

Commit

Permalink
Global CONFIG_FILE variable defined without extern in header file
Browse files Browse the repository at this point in the history
  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
  • Loading branch information
beorn- committed Jun 11, 2020
1 parent 92c51fc commit a476a9c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/umonitor.c
Expand Up @@ -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, ...)
{
Expand Down Expand Up @@ -127,6 +129,7 @@ void print_state(const char *format, ...)

/*! Logic for parsing options here*/


int main(int argc, char **argv)
{
home_directory = getenv("HOME");
Expand All @@ -147,6 +150,7 @@ int main(int argc, char **argv)
print_info();

screen_class_constructor(&screen_o);

CONFIG_FILE =
umalloc((strlen(home_directory) + strlen(conf_location))+1);
strcpy(CONFIG_FILE, home_directory);
Expand Down
2 changes: 1 addition & 1 deletion 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,
Expand Down

0 comments on commit a476a9c

Please sign in to comment.