Thread View: gnu.utils.bug
1 messages
1 total messages
Started by u90jl
Sun, 13 Dec 1992 22:22
Minor bug in bison version 1.19
Author: u90jl
Date: Sun, 13 Dec 1992 22:22
Date: Sun, 13 Dec 1992 22:22
61 lines
2171 bytes
2171 bytes
If %semantic_parser is not being used and debugging is switched off
(with YYDEBUG unset), yyrhs is output unnecessarily. I discovered this
when compiling such an output file with "gcc -Wall", which gave me a
warning that yyrhs was not being used.
When yyprhs and yyrhs are output by bison (in output.c), yyprhs is
surrounded by a "#if YYDEBUG != 0", "#endif" pair. The fix is to move
the #endif down so yyrhs can also by #if'd out when necessary.
Patch follows.
Jamie
p.s. What does %semantic_parser do anyway? I'm sure I've seen this
asked before, but I haven't seen a reply. Perhaps someone could
give me a reference to look up?
-------------------------------------------------------------------------------
*** output.c Sat Apr 18 23:18:38 1992
--- output.c Sun Dec 13 22:07:23 1992
***************
*** 315,321 ****
register int j;
register short *sp;
! /* With the ordinary parser, yyprhs is needed only for yydebug. */
if (!semantic_parser)
fprintf(ftable, "\n#if YYDEBUG != 0");
--- 315,321 ----
register int j;
register short *sp;
! /* With the ordinary parser, yyprhs and yyrhs are needed only for yydebug. */
if (!semantic_parser)
fprintf(ftable, "\n#if YYDEBUG != 0");
***************
*** 341,349 ****
fprintf(ftable, "\n};\n");
- if(!semantic_parser)
- fprintf(ftable, "\n#endif\n");
-
fprintf(ftable, "\nstatic const short yyrhs[] = {%6d", ritem[0]);
j = 10;
--- 341,346 ----
***************
*** 368,373 ****
--- 365,373 ----
}
fprintf(ftable, "\n};\n");
+
+ if(!semantic_parser)
+ fprintf(ftable, "#endif\n");
}
-------------------------------------------------------------------------------
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads