[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-bison] [patch] stdio.h not always needed in output

From: Eric Buddington
Subject: [Bug-bison] [patch] stdio.h not always needed in output
Date: Sat, 16 Sep 2000 10:36:17 -0400
User-agent: Mutt/1.0.1i

I'm writing code for a bare-bones (no libc) environment, and bison's
#inclusion of <stdio.h> is messing up my namespace. This header is
only needed for debugging messages, as far as I can tell, so it should
be #ifdef'd like this:

diff -ur bison-1.28/src/output.c bison-1.28-erb1/src/output.c
--- bison-1.28/src/output.c     Wed Jan 20 17:55:06 1999
+++ bison-1.28-erb1/src/output.c        Sat Sep 16 10:22:42 2000
@@ -267,7 +267,7 @@
     fprintf(ftable, "#include \"%s\"\n", attrsfile);
   if (! noparserflag)
-    fprintf(ftable, "#include <stdio.h>\n\n");
+    fprintf(ftable, "#if YYDEBUG != 0\n#include <stdio.h>\n#endif\n\n");
   /* Make "const" do nothing if not in ANSI C.  */
   fprintf (ftable, "#ifndef __cplusplus\n#ifndef __STDC__\n#define 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]