aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Kernighan <fakeuser@fake.com>2018-10-25 13:28:54 -0400
committerBrian Kernighan <fakeuser@fake.com>2018-10-25 13:28:54 -0400
commite8c280034fad30d5234590ac3c62ebd0fe3d25dd (patch)
tree886909437833413438a58f520b5ae0d7d0c26140
parent2dc7e5ff1a4feeeb549f32706cf34e17aba89192 (diff)
downloadone-true-awk-e8c280034fad30d5234590ac3c62ebd0fe3d25dd.tar.gz
fix maketab non-bug
-rw-r--r--FIXES5
-rw-r--r--makefile4
-rw-r--r--maketab.c2
3 files changed, 9 insertions, 2 deletions
diff --git a/FIXES b/FIXES
index d414c6d..909afb7 100644
--- a/FIXES
+++ b/FIXES
@@ -25,6 +25,11 @@ THIS SOFTWARE.
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.
diff --git a/makefile b/makefile
index ae80e4d..e0a43da 100644
--- a/makefile
+++ b/makefile
@@ -34,8 +34,8 @@ CC = gcc -g -Wall -pedantic
# 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
diff --git a/maketab.c b/maketab.c
index e23974c..bb8e317 100644
--- a/maketab.c
+++ b/maketab.c
@@ -135,6 +135,8 @@ int main(int argc, char *argv[])
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;