shithub: trueawk

Download patch

ref: e8c280034fad30d5234590ac3c62ebd0fe3d25dd
parent: 2dc7e5ff1a4feeeb549f32706cf34e17aba89192
author: Brian Kernighan <fakeuser@fake.com>
date: Thu Oct 25 09:28:54 EDT 2018

fix maketab non-bug

--- a/FIXES
+++ b/FIXES
@@ -25,6 +25,11 @@
 This file lists all bug fixes, changes, etc., made since the AWK book
 was sent to the printers in August, 1987.
 
+Oct 25, 2018:
+	Added test in maketab.c to prevent generating a proctab entry
+	for YYSTYPE_IS_DEFINED.  It was harmless but some gcc settings
+	generated a warning message.  Thanks to Nan Xiao for report.
+
 Aug 27, 2018:
 	Disallow '$' in printf formats; arguments evaluated in order
 	and printed in order.
--- a/makefile
+++ b/makefile
@@ -34,8 +34,8 @@
 
 # yacc options.  pick one; this varies a lot by system.
 #YFLAGS = -d -S
-#YACC = bison -d -y
-YACC = yacc -d
+YACC = bison -d -y
+#YACC = yacc -d
 #		-S uses sprintf in yacc parser instead of sprint
 
 OFILES = b.o main.o parse.o proctab.o tran.o lib.o run.o lex.o
--- a/maketab.c
+++ b/maketab.c
@@ -135,6 +135,8 @@
 		n = sscanf(buf, "%1c %s %s %d", &c, def, name, &tok);
 		if (c != '#' || (n != 4 && strcmp(def,"define") != 0))	/* not a valid #define */
 			continue;
+		if (strcmp(name, "YYSTYPE_IS_DECLARED") == 0)
+			continue;
 		if (tok < FIRSTTOKEN || tok > LASTTOKEN) {
 			/* fprintf(stderr, "maketab funny token %d %s ignored\n", tok, buf); */
 			continue;
--