|
From: | Tim Mann |
Subject: | Re: [PATCH] xboard: fix build failure against gcc-10 |
Date: | Sat, 25 Jan 2020 21:06:31 -0800 |
On gcc-10 (and gcc-9 -fno-common) build fails as:
```
CCLD xboard
ld: book.o:(.bss+0x0): multiple definition of `ics_type'; backend.o:(.bss+0x0): first defined here
ld: childio.o:(.bss+0x0): multiple definition of `ics_type'; backend.o:(.bss+0x0): first defined here
ld: gamelist.o:(.bss+0x0): multiple definition of `ics_type'; backend.o:(.bss+0x0): first defined here
ld: ngamelist.o:(.bss+0x0): multiple definition of `ics_type'; backend.o:(.bss+0x0): 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.
Signed-off-by: Sergei Trofimovich <address@hidden>
---
backend.h | 2 +-
evalgraph.h | 2 +-
xaw/xhistory.c | 1 -
3 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/backend.h b/backend.h
index fae2ee63..bd280eae 100644
--- a/backend.h
+++ b/backend.h
@@ -242,7 +242,7 @@ extern GameInfo gameInfo;
/* ICS vars used with backend.c and zippy.c */
enum ICS_TYPE { ICS_GENERIC, ICS_ICC, ICS_FICS, ICS_CHESSNET /* not really supported */ };
-enum ICS_TYPE ics_type;
+extern enum ICS_TYPE ics_type;
/* pgntags.c prototypes
*/
diff --git a/evalgraph.h b/evalgraph.h
index f4b4f920..2ab0e3c1 100644
--- a/evalgraph.h
+++ b/evalgraph.h
@@ -34,7 +34,7 @@ typedef enum { PEN_NONE, PEN_BLACK, PEN_DOTTED, PEN_BLUEDOTTED, PEN_BOLDWHITE, P
#define OPEN 0
/* Module globals */
-ChessProgramStats_Move * currPvInfo;
+extern ChessProgramStats_Move * currPvInfo;
extern int currFirst;
extern int currLast;
extern int currCurrent;
diff --git a/xaw/xhistory.c b/xaw/xhistory.c
index 6aa79f26..5b124f42 100644
--- a/xaw/xhistory.c
+++ b/xaw/xhistory.c
@@ -96,7 +96,6 @@ ScrollToCursor (Option *opt, int caretPos)
// ------------------------------ callbacks --------------------------
-char *historyText;
char historyTranslations[] =
"<Btn3Down>: select-start() \n \
<Btn3Up>: extend-end(PRIMARY) SelectMove() \n";
--
2.25.0
[Prev in Thread] | Current Thread | [Next in Thread] |