Skip to content

Commit d1469ab

Browse files
Sergei Trofimovichstevenh
authored andcommitted
qstat: fix build failure against gcc-10
On gcc-10 (and gcc-9 -fno-common) build fails as: ``` gcc ... -o qstat ... ld: config.o:qstat/display_json.h:24: multiple definition of `json_printed'; xform.o:qstat/display_json.h:24: first defined here ld: config.o:qstat/display_json.h:23: multiple definition of `json_encoding'; xform.o:qstat/display_json.h:23: first defined here ``` gcc-10 will change the default from -fcommon to fno-common: https://gcc.gnu.org/PR85678. The error also happens if CFLAGS=-fno-common passed explicitly. Reported-by: Toralf Förster Bug: https://bugs.gentoo.org/706390 Signed-off-by: Sergei Trofimovich <[email protected]>
1 parent 85fbecb commit d1469ab

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

debug.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ malformed_packet(const struct qserver *server, const char *fmt, ...)
127127
close(fd);
128128
}
129129

130-
130+
int do_dump;
131131
ssize_t
132132
send_dump(int s, const void *buf, size_t len, int flags)
133133
{

debug.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ void dump_packet(const char *buf, int buflen);
4848
#endif
4949
#include <sys/types.h>
5050
#include <sys/stat.h>
51-
int do_dump;
51+
extern int do_dump;
5252
ssize_t send_dump(int s, const void *buf, size_t len, int flags);
5353

5454
#ifndef QSTAT_DEBUG_C

display_json.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
#include "qstat.h"
2020
#include "qserver.h"
2121

22-
int json_display;
23-
int json_encoding;
24-
int json_printed;
22+
extern int json_display;
23+
extern int json_encoding;
24+
extern int json_printed;
2525

2626
void json_footer();
2727
void json_header();

0 commit comments

Comments
 (0)