bison-patches
[Top][All Lists]
Advanced

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

Re: 1.75 test suite failures with Sun C compiler


From: Paul Eggert
Subject: Re: 1.75 test suite failures with Sun C compiler
Date: Wed, 13 Nov 2002 15:21:04 -0800

> From: Albert Chin-A-Young <address@hidden>
> Date: Wed, 13 Nov 2002 14:48:42 -0600
> 
> "glr-regr1.y", line 5: warning: tokens ignored at end of directive line
> ...
> [Problem is probably because you're using // as the comment for a C
>  source file.]

Yes, that's it.  I installed the following patch.

2002-11-13  Paul Eggert  <address@hidden>

        * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
        comments, since they're not portable.  Use GNU coding style.

--- glr-regr1.at.~1.2.~ 2002-11-04 00:30:18.000000000 -0800
+++ glr-regr1.at        2002-11-13 15:16:26.160682000 -0800
@@ -25,7 +25,7 @@ AT_DATA([glr-regr1.y],
 /* Reported by Scott McPeak */
 
 %{
-#include <stdio.h>    // fgetc, printf
+#include <stdio.h>
 
 #define YYSTYPE int
 static YYSTYPE exprMerge (YYSTYPE x0, YYSTYPE x1);
@@ -63,29 +63,29 @@ static YYSTYPE exprMerge (YYSTYPE x0, YY
 int
 main (void)
 {
-  yyparse();
+  yyparse ();
   return 0;
 }
 
 int
 yyerror (char const *msg)
 {
-  printf("%s\n", msg);
-  exit(4);
+  fprintf (stderr, "%s\n", msg);
+  exit (4);
 }
 
 
 int
 yylex (void)
 {
-  while (1) {
-    int ch = fgetc(stdin);
-    if (ch == EOF) {
-      return 0;   // bison's EOF
-    } else if (ch == 'B' || ch == 'P') {
-      return ch;
+  for (;;)
+    {
+      int ch = getchar ();
+      if (ch == EOF)
+       return 0;
+      else if (ch == 'B' || ch == 'P')
+       return ch;
     }
-  }
 }
 ]])
 




reply via email to

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