diff options
author | Brian Kernighan <fakeuser@fake.com> | 2018-10-25 13:28:54 -0400 |
---|---|---|
committer | Brian Kernighan <fakeuser@fake.com> | 2018-10-25 13:28:54 -0400 |
commit | e8c280034fad30d5234590ac3c62ebd0fe3d25dd (patch) | |
tree | 886909437833413438a58f520b5ae0d7d0c26140 | |
parent | 2dc7e5ff1a4feeeb549f32706cf34e17aba89192 (diff) | |
download | one-true-awk-e8c280034fad30d5234590ac3c62ebd0fe3d25dd.tar.gz |
fix maketab non-bug
-rw-r--r-- | FIXES | 5 | ||||
-rw-r--r-- | makefile | 4 | ||||
-rw-r--r-- | maketab.c | 2 |
3 files changed, 9 insertions, 2 deletions
@@ -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. @@ -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 @@ -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; |