summaryrefslogtreecommitdiffstats
path: root/usr.bin/yacc/output.c
diff options
context:
space:
mode:
authorsteve <steve@FreeBSD.org>1997-04-28 03:36:13 +0000
committersteve <steve@FreeBSD.org>1997-04-28 03:36:13 +0000
commitbafc3a0eb8183b0152381ddb67f2786e9f6b2623 (patch)
tree86f2d7614b9ebad29aa13420ce093b1b0739cdc2 /usr.bin/yacc/output.c
parent9b0ffd7cdce34fca58f4d753d65be928b091b2a8 (diff)
downloadFreeBSD-src-bafc3a0eb8183b0152381ddb67f2786e9f6b2623.zip
FreeBSD-src-bafc3a0eb8183b0152381ddb67f2786e9f6b2623.tar.gz
Fix problems using -Wwrite-strings and -Wcast-qual with yacc generated
parsers. Closes PR #2792. Submitted by: Tim Vanderhoek
Diffstat (limited to 'usr.bin/yacc/output.c')
-rw-r--r--usr.bin/yacc/output.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.bin/yacc/output.c b/usr.bin/yacc/output.c
index 432989b..b2a51cb 100644
--- a/usr.bin/yacc/output.c
+++ b/usr.bin/yacc/output.c
@@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id$
+ * $Id: output.c,v 1.7 1997/02/22 19:58:00 peter Exp $
*/
#ifndef lint
@@ -945,7 +945,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#endif\n",
+ fprintf(code_file, "#ifndef YYDEBUG\n#define YYDEBUG %d\n"
+ "#elif YYDEBUG\n#include <stdio.h>\n#endif\n",
tflag);
if (rflag)
fprintf(output_file, "#ifndef YYDEBUG\n#define YYDEBUG %d\n#endif\n",
@@ -970,7 +971,8 @@ output_debug()
symnam[0] = "end-of-file";
if (!rflag) ++outline;
- fprintf(output_file, "#if YYDEBUG\nchar *%sname[] = {", symbol_prefix);
+ fprintf(output_file, "#if YYDEBUG\n"
+ "const char * const %sname[] = {", symbol_prefix);
j = 80;
for (i = 0; i <= max; ++i)
{
OpenPOWER on IntegriCloud