summaryrefslogtreecommitdiffstats
path: root/usr.bin/yacc
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>2000-01-17 01:51:29 +0000
committerbde <bde@FreeBSD.org>2000-01-17 01:51:29 +0000
commit6b3da1fe217669fc48bdbe87a215479561125599 (patch)
treeaf4ca42287c00706c1e9e0420ab29928f7d56cae /usr.bin/yacc
parente4c252507c927b124a5f6a4a03d900823259a11b (diff)
downloadFreeBSD-src-6b3da1fe217669fc48bdbe87a215479561125599.zip
FreeBSD-src-6b3da1fe217669fc48bdbe87a215479561125599.tar.gz
Fixed breakage of K&R support in rev.1.8 of output.c: don't generate
#elif. Cleaned up rev.1.8 a bit more: generate the #include of <stdio.h> closer to the code that needs it.
Diffstat (limited to 'usr.bin/yacc')
-rw-r--r--usr.bin/yacc/output.c4
-rw-r--r--usr.bin/yacc/skeleton.c3
2 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/yacc/output.c b/usr.bin/yacc/output.c
index 2b6000a..18d5ee1 100644
--- a/usr.bin/yacc/output.c
+++ b/usr.bin/yacc/output.c
@@ -953,8 +953,8 @@ output_debug()
++outline;
fprintf(code_file, "#define YYFINAL %d\n", final_state);
outline += 3;
- fprintf(code_file, "#ifndef YYDEBUG\n#define YYDEBUG %d\n", tflag);
- fprintf(code_file, "#elif YYDEBUG\n#include <stdio.h>\n#endif\n");
+ fprintf(code_file, "#ifndef YYDEBUG\n#define YYDEBUG %d\n#endif\n",
+ tflag);
if (rflag)
fprintf(output_file, "#ifndef YYDEBUG\n#define YYDEBUG %d\n#endif\n",
tflag);
diff --git a/usr.bin/yacc/skeleton.c b/usr.bin/yacc/skeleton.c
index 1eb07df..e54d790 100644
--- a/usr.bin/yacc/skeleton.c
+++ b/usr.bin/yacc/skeleton.c
@@ -93,6 +93,9 @@ char *tables[] =
char *header[] =
{
+ "#if YYDEBUG",
+ "#include <stdio.h>",
+ "#endif",
"#ifdef YYSTACKSIZE",
"#undef YYMAXDEPTH",
"#define YYMAXDEPTH YYSTACKSIZE",
OpenPOWER on IntegriCloud