Skip to content

Commit

Permalink
GCC-10: default to -fno-common by default
Browse files Browse the repository at this point in the history
GCC-10+ has switched -fno-common on by default.  Previously, this was
causing compilation failures where the .DATA blocks are now used, which
means extern variables need declaring outside of .h files.

This change makes those adjustments.

Fixes #119
  • Loading branch information
ThomasAdam committed Jun 3, 2020
1 parent d23ba82 commit 8562844
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ AC_PROG_CPP

# added -Wall for gcc, what about for others?
if test "x$GCC" = "xyes"; then
CFLAGS="-Wall -Wno-implicit-int -fcommon $CFLAGS"
CFLAGS="-Wall -Wno-implicit-int -fno-common $CFLAGS"
fi

# Help finding POSIX functions on some systems
Expand Down
2 changes: 2 additions & 0 deletions fvwm/virtual.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ static int last_edge_thickness = 2;
static void store_desktop_cmd(int, char *);
static int number_of_desktops(struct monitor *);

struct desktop_cmds desktop_cmd_q;

/* ---------------------------- exported variables (globals) --------------- */

/* ---------------------------- local functions ---------------------------- */
Expand Down
2 changes: 1 addition & 1 deletion fvwm/virtual.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ struct desktop_cmd {
TAILQ_ENTRY(desktop_cmd) entry;
};
TAILQ_HEAD(desktop_cmds, desktop_cmd);
struct desktop_cmds desktop_cmd_q;
extern struct desktop_cmds desktop_cmd_q;

void apply_desktops_monitor(struct monitor *);

Expand Down
6 changes: 6 additions & 0 deletions libs/FScreen.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ static void monitor_set_flags(struct monitor *);
static void scan_screens(Display *);
static void monitor_check_primary(void);

enum monitor_tracking monitor_mode;
DesktopsInfo *ReferenceDesktops;
struct screen_infos screen_info_q;
struct monitors monitor_q;
int randr_event;

static void GetMouseXY(XEvent *eventp, int *x, int *y)
{
XEvent e;
Expand Down
10 changes: 5 additions & 5 deletions libs/FScreen.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ enum monitor_tracking
MONITOR_TRACKING_M,
};

enum monitor_tracking monitor_mode;
DesktopsInfo *ReferenceDesktops;
extern enum monitor_tracking monitor_mode;
extern DesktopsInfo *ReferenceDesktops;

struct screen_info {
const char *name;
Expand All @@ -85,7 +85,7 @@ struct screen_info {
};
TAILQ_HEAD(screen_infos, screen_info);

struct screen_infos screen_info_q;
extern struct screen_infos screen_info_q;

struct screen_info *screen_info_new(void);
struct screen_info *screen_info_by_name(const char *);
Expand Down Expand Up @@ -150,7 +150,7 @@ struct monitor {
};
TAILQ_HEAD(monitors, monitor);

struct monitors monitor_q;
extern struct monitors monitor_q;

struct monitor *monitor_by_name(const char *);
struct monitor *monitor_by_xy(int, int);
Expand All @@ -166,7 +166,7 @@ void monitor_add_new(void);

#define FSCREEN_MANGLE_USPOS_HINTS_MAGIC ((short)-32109)

int randr_event;
extern int randr_event;

/* Control */
Bool FScreenIsEnabled(void);
Expand Down
2 changes: 2 additions & 0 deletions modules/FvwmPager/FvwmPager.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ PagerStringList *NewPagerStringItem(PagerStringList *last, int desk);
extern FlocaleFont *FwindowFont;
extern Pixmap default_pixmap;

struct fpmonitors fp_monitor_q;

/*
*
* Screen, font, etc info
Expand Down
2 changes: 1 addition & 1 deletion modules/FvwmPager/FvwmPager.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ struct fpmonitor {
};
TAILQ_HEAD(fpmonitors, fpmonitor);

struct fpmonitors fp_monitor_q;
extern struct fpmonitors fp_monitor_q;
struct fpmonitor *fpmonitor_by_name(const char *);
struct fpmonitor *fpmonitor_by_output(int);
struct fpmonitor *fpmonitor_get_current(void);
Expand Down

0 comments on commit 8562844

Please sign in to comment.