[PATCH] xboard: fix build failure against gcc-10

Sergei Trofimovich <[email protected]> Tue, 21 Jan 2020 23:36:31 +0000
Newsgroups gmane.comp.gnu.xboard.devel
Message-ID <[email protected]>
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=3D-fno-common passed explicitly.

Signed-off-by: Sergei Trofimovich <[email protected]>
---
 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;
=20
 /* ICS vars used with backend.c and zippy.c */
 enum ICS_TYPE { ICS_GENERIC, ICS_ICC, ICS_FICS, ICS_CHESSNET /* not real=
ly supported */ };
-enum ICS_TYPE ics_type;
+extern enum ICS_TYPE ics_type;
=20
 /* 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_BLU=
EDOTTED, PEN_BOLDWHITE, P
 #define OPEN   0
=20
 /* 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)
=20
 // ------------------------------ callbacks --------------------------
=20
-char *historyText;
 char historyTranslations[] =3D
 "<Btn3Down>: select-start() \n \
 <Btn3Up>: extend-end(PRIMARY) SelectMove() \n";
--=20
2.25.0