bug-bison
[Top][All Lists]
Advanced

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

Re: bison-1.75c, take 2: feedback


From: Paul Eggert
Subject: Re: bison-1.75c, take 2: feedback
Date: Thu, 14 Nov 2002 14:57:30 -0800

> From: "Nelson H. F. Beebe" <address@hidden>
> Date: Thu, 14 Nov 2002 07:31:59 -0700 (MST)
>
> On Apple Darwin, I also got this failure:
>
> 4: input.at:93       FAILED near `input.at:207'
> ...
> stderr:
> input.y:16: illegal external declaration, found `/'

Sigh.  Yet another compiler bug to work around.  I installed the
following change in an attempt to work around this one.

If this happens too much more, perhaps we should remove these torture
tests, as they seem to be more trouble than they're worth.

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

        * tests/input.at (Torturing the Scanner): Surround the
        backslash-newline tests with "#if 0", to make it less likely that
        we'll run into compiler bugs.  Bring back solitary \ inside
        comment, but add a closing comment to work around HP C bug.  Don't
        test backslash-newline in C character constant.  This should fix
        the input.at bug reported by Nelson H. F. Beebe in
        <http://mail.gnu.org/pipermail/bug-bison/2002-November/001893.html>.

Index: input.at
===================================================================
RCS file: /cvsroot/bison/bison/tests/input.at,v
retrieving revision 1.20
retrieving revision 1.21
diff -p -u -r1.20 -r1.21
--- input.at    14 Nov 2002 09:58:01 -0000      1.20
+++ input.at    14 Nov 2002 22:53:47 -0000      1.21
@@ -97,18 +97,33 @@ AT_DATA_GRAMMAR([input.y],
 /* This is seen in GCC: a %{ and %} in middle of a comment. */
 const char *foo = "So %{ and %} can be here too.";
 
-#ifdef __STDC__
+#if 0
+/* These examples test Bison while not stressing C compilers too much.
+   Many C compilers mishandle backslash-newlines, so this part of the
+   test is inside "#if 0".  The comment and string are written so that
+   the "#endif" will be seen regardless of the C compiler bugs that we
+   know about, namely:
+
+     HP C (as of late 2002) mishandles *\[newline]\[newline]/ within a
+     comment.
+
+     The Apple Darwin compiler (as of late 2002) mishandles
+     \\[newline]' within a character constant.
+
+   */
+
 /\
-* A comment with backslash-newlines in it. %{ %} *\
+* A comment with backslash-newlines in it. %} *\
+\
 /
+/* { Close the above comment, if the C compiler mishandled it.  */
 
 char str[] = "\\
 " A string with backslash-newlines in it %{ %} \\
+\
 "";
 
-char apostrophe = '\\
-'\
-';
+char apostrophe = '\'';
 #endif
 
 #include <stdio.h>




reply via email to

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