Subject: bin/5568: backgammon(6) externs/commons patch
To: None <gnats-bugs@gnats.netbsd.org>
From: None <dholland@eecs.harvard.edu>
List: netbsd-bugs
Date: 06/10/1998 21:01:16
>Number:         5568
>Category:       bin
>Synopsis:       backgammon(6) doesn't extern all its globals; patch
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed Jun 10 18:50:01 1998
>Last-Modified:
>Originator:     David A. Holland
>Organization:
   - David A. Holland             |    VINO project home page:
     dholland@eecs.harvard.edu    | http://www.eecs.harvard.edu/vino
>Release:        1.3
>Environment:

	NetBSD 1.3 release (on x86, but cross-compiling for VINO)

>Description:
	backgammon(6) is missing "extern" on a few of its globals.
	Some of these are causing the VINO ELF linker to issue
	warnings, so I went in and fixed the lot. The patch is
	appended.

>How-To-Repeat:
	Compiling and linking backgammon with gnu binutils compiled
	for ELF causes warnings about the sizes of some symbols
	changing.

>Fix:

Index: backgammon/main.c
===================================================================
RCS file: /home/vino/repo/src/utils/bsd/games/backgammon/backgammon/main.c,v
retrieving revision 1.1.1.2
diff -u -r1.1.1.2 main.c
--- main.c	1998/05/28 23:24:06	1.1.1.2
+++ main.c	1998/06/11 01:12:32
@@ -53,9 +53,9 @@
 #define MVPAUSE	5		/* time to sleep when stuck */
 #define MAXUSERS 35		/* maximum number of users */
 
-char   *instr[];		/* text of instructions */
-char   *message[];		/* update message */
-speed_t ospeed;			/* tty output speed */
+extern char *instr[];		/* text of instructions */
+extern char *message[];		/* update message */
+static speed_t ospeed;		/* tty output speed */
 
 char   *helpm[] = {		/* help message */
 	"Enter a space or newline to roll, or",
Index: common_source/fancy.c
===================================================================
RCS file: /home/vino/repo/src/utils/bsd/games/backgammon/common_source/fancy.c,v
retrieving revision 1.1.1.2
diff -u -r1.1.1.2 fancy.c
--- fancy.c	1998/05/28 23:24:12	1.1.1.2
+++ fancy.c	1998/06/11 01:36:12
@@ -70,7 +70,7 @@
  /* corresponding strings */
 char  **tstr[] = {&BC, &CD, &CE, &CL, &CM, &HO, &MC, &ML, &ND, &UP};
 
-int     buffnum;		/* pointer to output buffer */
+extern int     buffnum;		/* pointer to output buffer */
 
 char    tbuf[1024];		/* buffer for decoded termcap entries */
 
>Audit-Trail:
>Unformatted: