Avoid duplicate "code_lines" symbols, which fails to link when building

tools with gcc 10.1.1 / ld 2.34-2.fc32.
This commit is contained in:
jmcneill 2020-05-22 22:59:14 +00:00
parent 7ce5ae7fe0
commit 3553aa7d2d
3 changed files with 9 additions and 7 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: defs.h,v 1.17 2019/10/15 15:58:46 christos Exp $ */
/* $NetBSD: defs.h,v 1.18 2020/05/22 22:59:14 jmcneill Exp $ */
/* Id: defs.h,v 1.61 2019/06/16 15:07:51 tom Exp */
@ -590,7 +590,7 @@ extern void reader(void);
struct code_lines {
char *lines;
size_t num;
} code_lines[CODE_MAX];
};
/* skeleton.c (generated by skel2c) */
extern void write_section(FILE * fp, const char *const section[]);

View File

@ -1,11 +1,11 @@
/* $NetBSD: output.c,v 1.21 2019/10/15 15:58:46 christos Exp $ */
/* $NetBSD: output.c,v 1.22 2020/05/22 22:59:14 jmcneill Exp $ */
/* Id: output.c,v 1.87 2018/05/10 09:08:46 tom Exp */
#include "defs.h"
#include <sys/cdefs.h>
__RCSID("$NetBSD: output.c,v 1.21 2019/10/15 15:58:46 christos Exp $");
__RCSID("$NetBSD: output.c,v 1.22 2020/05/22 22:59:14 jmcneill Exp $");
#define StaticOrR (rflag ? "" : "static ")
#define CountLine(fp) (!rflag || ((fp) == code_file))
@ -36,6 +36,8 @@ static Value_t *check;
static int lowzero;
static long high;
struct code_lines code_lines[CODE_MAX];
static void
output_code_lines(FILE *fp, int cl)
{

View File

@ -1,11 +1,11 @@
/* $NetBSD: reader.c,v 1.17 2019/10/15 15:58:46 christos Exp $ */
/* $NetBSD: reader.c,v 1.18 2020/05/22 22:59:14 jmcneill Exp $ */
/* Id: reader.c,v 1.74 2017/12/04 17:50:02 tom Exp */
#include "defs.h"
#include <sys/cdefs.h>
__RCSID("$NetBSD: reader.c,v 1.17 2019/10/15 15:58:46 christos Exp $");
__RCSID("$NetBSD: reader.c,v 1.18 2020/05/22 22:59:14 jmcneill Exp $");
/* The line size must be a positive integer. One hundred was chosen */
/* because few lines in Yacc input grammars exceed 100 characters. */
@ -71,7 +71,7 @@ static const char *code_keys[] = {
"", "requires", "provides", "top", "imports",
};
struct code_lines code_lines[CODE_MAX];
extern struct code_lines code_lines[CODE_MAX];
#if defined(YYBTYACC)
int destructor = 0; /* =1 if at least one %destructor */