home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / gnu / utils / bug / 2223 < prev    next >
Encoding:
Text File  |  1992-12-13  |  2.0 KB  |  75 lines

  1. Newsgroups: gnu.utils.bug
  2. Path: sparky!uunet!cis.ohio-state.edu!ecs.ox.ac.UK!u90jl
  3. From: u90jl@ecs.ox.ac.UK
  4. Subject: Minor bug in bison version 1.19
  5. Message-ID: <9212132222.AA04247@booth2.ecs.ox.ac.uk>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: GNUs Not Usenet
  8. Distribution: gnu
  9. Date: Sun, 13 Dec 1992 22:22:48 GMT
  10. Approved: bug-gnu-utils@prep.ai.mit.edu
  11. Lines: 62
  12.  
  13. If %semantic_parser is not being used and debugging is switched off
  14. (with YYDEBUG unset), yyrhs is output unnecessarily.  I discovered this
  15. when compiling such an output file with "gcc -Wall", which gave me a
  16. warning that yyrhs was not being used.
  17.  
  18. When yyprhs and yyrhs are output by bison (in output.c), yyprhs is
  19. surrounded by a "#if YYDEBUG != 0", "#endif" pair.  The fix is to move
  20. the #endif down so yyrhs can also by #if'd out when necessary.
  21.  
  22. Patch follows.
  23.  
  24. Jamie
  25.  
  26. p.s. What does %semantic_parser do anyway?  I'm sure I've seen this
  27.      asked before, but I haven't seen a reply.  Perhaps someone could
  28.      give me a reference to look up?
  29. -------------------------------------------------------------------------------
  30. *** output.c    Sat Apr 18 23:18:38 1992
  31. --- output.c    Sun Dec 13 22:07:23 1992
  32. ***************
  33. *** 315,321 ****
  34.     register int j;
  35.     register short *sp;
  36.   
  37. !   /* With the ordinary parser, yyprhs is needed only for yydebug.  */
  38.     if (!semantic_parser)
  39.       fprintf(ftable, "\n#if YYDEBUG != 0");
  40.   
  41. --- 315,321 ----
  42.     register int j;
  43.     register short *sp;
  44.   
  45. !   /* With the ordinary parser, yyprhs and yyrhs are needed only for yydebug. */
  46.     if (!semantic_parser)
  47.       fprintf(ftable, "\n#if YYDEBUG != 0");
  48.   
  49. ***************
  50. *** 341,349 ****
  51.   
  52.     fprintf(ftable, "\n};\n");
  53.   
  54. -   if(!semantic_parser)
  55. -     fprintf(ftable, "\n#endif\n");
  56.     fprintf(ftable, "\nstatic const short yyrhs[] = {%6d", ritem[0]);
  57.   
  58.     j = 10;
  59. --- 341,346 ----
  60. ***************
  61. *** 368,373 ****
  62. --- 365,373 ----
  63.       }
  64.   
  65.     fprintf(ftable, "\n};\n");
  66. +   if(!semantic_parser)
  67. +     fprintf(ftable, "#endif\n");
  68.   }
  69.   
  70.   
  71. -------------------------------------------------------------------------------
  72.  
  73.