bug-bison
[Top][All Lists]
Advanced

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

Re: YYSTYPE_IS_TRIVIAL


From: Akim Demaille
Subject: Re: YYSTYPE_IS_TRIVIAL
Date: 23 Apr 2002 11:07:06 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Common Lisp)

| configure.in:32: error: `intl/Makefile' is already registered with 
AC_CONFIG_FILES.
| autoconf/status.m4:831: AC_CONFIG_FILES is expanded from...
| configure.in:32: the top level
| autoreconf: autoconf failed with exit status: 1
|  at /tmp/prefix/bin/autoreconf line 475
| #PRE The above looks like a real problem, but I'm not sure what.
| #PRE

Yes it is.  I don't understand it.  You are not the only one to
observe it, but it seems totally non deterministic.  I'm unable to
reproduce it here.  I'll try to understand it, but currently I'm
running out of imagination.

| rm: po/Makevars.template: override protection 444 (yes/no)? yes
| #PRE I shouldn't have to type "yes".

Hm...  Sorry, I'll handle that.

| #PRE The above problem caused the bootstrap to fail, so I worked around
| #PRE it by running autoheader by hand, and then rerrunning bootstrap.

Running autoheader?  Hm, maybe we have a timestamp difference between
you and me, and I'm on the lucky configuration?


| mv: cannot access m4/Makefile.am~
| mv: cannot access Makefile.am~
| mv: cannot access configure.in~
| rm: po/Makevars.template: override protection 444 (yes/no)? yes
| #PRE Again, I shouldn't have to type "yes".

Agreed, sorry.  Fixed too.

| 362-sic $ gmake
| cd . && /bin/bash /net/knick/home/eggert/src/gnu/bison.tmp/config/missing 
--run aclocal-1.6 -I m4
| #PRE Why does it run aclocal again here?  Surely everything is up to date.

Very much agreed.

Actually, the problem is that I'm not sure what is right.  What
happens is that autoreconf sees that aclocal will produce the same
aclocal.m4, so it decides not to update it, it just leaves the old
one.  But then, the Makefile see that aclocal.m4 is `obsolete' as
compared to one of its sources.

My problem is that in this context, it is clear that autoreconf should
always update aclocal.m4, but in other contexts, that's a waste of
time, as it will trigger a recompilation of configure, config.hin and
so forth.

What I would like is being able to see if aclocal.m4 is up to date as
compared to its sources, unfortunately, aclocal.m4 does not reveal its
sources, so I can't.  If only aclocal.m4 was composed of `include's,
that would be dead easy :(

What would you do?  autoreconf is suppposed to be smart, and avoid
useless time stamp changes.


| ## --------------------------- ##
| ## GNU Bison 1.49a test suite. ##
| ## --------------------------- ##
| 19. sets.at:65: testing Nullable...
| sets.at:80: bison --trace input.y
| [...]
| Lookaheads: END
| running: /opt/sfw/bin/gm4 -I /net/knick/home/eggert/src/gnu/bison.tmp/data 
m4sugar/m4sugar.m4 /tmp/bsnIcaywr bison.simple
| sets.at:81: sed -f extract.sed stderr
| --- /dev/null 2002-04-22 15:02:54.000000000 -0700
| +++ /net/knick/home/eggert/src/gnu/bison.tmp/tests/testsuite.dir/at-stderr    
2002-04-22 15:02:55.810403000 -0700
| @@ -0,0 +1 @@
| +Label too long:    :nullable

Arg.  I thought portable sed labels are 8 char long.  That's what
autoconf.texi says.  Here is the script I used:


         # AT_EXTRACT_SETS(INPUT, OUTPUT)
         # ------------------------------
         # Extract the information about the grammar sets from a bison
         # trace output (INPUT), and save it in OUTPUT.
         # And remember, there is no alternation in portable sed.
         m4_define([AT_EXTRACT_SETS],
         [AT_DATA([extract.sed],
         [[#n
         /^NULLABLE$/ {
            :nullable
            p
            n
            /^[  ]*$/! b nullable
         }
         /^FIRSTS$/ {
            :firsts
            p
            n
            /^[  ]*$/! b firsts
         }
         /^FDERIVES$/ {
            :fderives
            p
            n
            /^[  ]*$/! b fderives
         }
         /^DERIVES$/ {
            :derives
            p
            n
            /^[  ]*$/! b derives
         }
         ]])
         AT_CHECK([sed -f extract.sed $1], 0, [stdout])
         AT_CHECK([mv stdout $2])
         ])
         
I suppose using null instead of nullable will solve these one.
fderives is too long too.


| 27. synclines.at:54: testing Prologue synch line...
| synclines.at:54: test "$GCC" = yes || exit 77
| synclines.at:54: bison input.y -o input.c
| synclines.at:54: $CC $CFLAGS $CPPFLAGS input.c -o input
| --- - 2002-04-22 15:02:57.514707295 -0700
| +++ /net/knick/home/eggert/src/gnu/bison.tmp/tests/testsuite.dir/at-stderr    
2002-04-22 15:02:57.503403000 -0700
| @@ -1,2 +1,2 @@
| -input.y:2: #error "2"
| +input.y:2:2: #error "2"
|  

Heck.  I upgraded my GCC too, and observe the same failure.  Hm... the
test aims at checking that the #line are correct.  It uses the
compiler to this end.

For instance:

      AT_TEST_SYNCLINE([Prologue synch line],
      [[%{
      #error "2"
      %}
      %%
      exp: '0';
      ]],
      [input.y:2: #error "2"
      ])

We expect the compiler (required to be GCC, otherwise the test is
skipped) to complain in line 2.  But now, it includes the column
(which is weird here, btw).  The easiest, I guess, is to normalize the
error message beforehand: removing the optional column information.

| 38. conflicts.at:48: testing %nonassoc and eof...
| conflicts.at:97: bison input.y -o input.c
| conflicts.at:98: $CC $CFLAGS $CPPFLAGS input.c -o input
| stderr:
| input.y:6:19: error.h: No such file or directory
| conflicts.at:98: exit code was 1, expected 0
| 38. conflicts.at:48: FAILED near `conflicts.at:98'

Arg.  A test that was written non portably, and was not fixed since.
Thanks.

| #PRE Seems like a lot of test failures; should I be getting that many?

Nope :)  Thanks for the report, I'm applying the following patch.

Index: ChangeLog
from  Akim Demaille  <address@hidden>

        * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
        * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
        location with columns.
        * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
        All reported by Paul Eggert.

Index: tests/conflicts.at
===================================================================
RCS file: /cvsroot/bison/bison/tests/conflicts.at,v
retrieving revision 1.3
diff -u -u -r1.3 conflicts.at
--- tests/conflicts.at 9 Apr 2002 19:19:59 -0000 1.3
+++ tests/conflicts.at 23 Apr 2002 09:06:28 -0000
@@ -50,16 +50,22 @@
 AT_DATA([input.y],
 [[
 %{
+#include <config.h>
+/* We don't need a perfect malloc for these tests. */
+#undef malloc
 #include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <error.h>
+
+#if STDC_HEADERS
+# include <stdlib.h>
+#endif
+
 #define YYERROR_VERBOSE 1
-#define yyerror(Msg) \
-do { \
-  fprintf (stderr, "%s\n", Msg); \
-  exit (1); \
-} while (0)
+static void
+yyerror (const char *msg)
+{
+  fprintf (stderr, "%s\n", msg);
+  exit (1);
+}
 
 /* The current argument. */
 static const char *input = NULL;
Index: tests/sets.at
===================================================================
RCS file: /cvsroot/bison/bison/tests/sets.at,v
retrieving revision 1.10
diff -u -u -r1.10 sets.at
--- tests/sets.at 4 Mar 2002 14:29:27 -0000 1.10
+++ tests/sets.at 23 Apr 2002 09:06:28 -0000
@@ -1,5 +1,5 @@
 # Exercising Bison Grammar Sets.                      -*- Autotest -*-
-# Copyright 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -16,6 +16,7 @@
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 # 02111-1307, USA.
 
+
 # AT_EXTRACT_SETS(INPUT, OUTPUT)
 # ------------------------------
 # Extract the information about the grammar sets from a bison
@@ -25,10 +26,10 @@
 [AT_DATA([extract.sed],
 [[#n
 /^NULLABLE$/ {
-   :nullable
+   :null
    p
    n
-   /^[         ]*$/! b nullable
+   /^[         ]*$/! b null
 }
 /^FIRSTS$/ {
    :firsts
@@ -37,16 +38,16 @@
    /^[         ]*$/! b firsts
 }
 /^FDERIVES$/ {
-   :fderives
+   :fderiv
    p
    n
-   /^[         ]*$/! b fderives
+   /^[         ]*$/! b fderiv
 }
 /^DERIVES$/ {
-   :derives
+   :deriv
    p
    n
-   /^[         ]*$/! b derives
+   /^[         ]*$/! b deriv
 }
 ]])
 AT_CHECK([sed -f extract.sed $1], 0, [stdout])
Index: tests/synclines.at
===================================================================
RCS file: /cvsroot/bison/bison/tests/synclines.at,v
retrieving revision 1.1
diff -u -u -r1.1 synclines.at
--- tests/synclines.at 19 Mar 2002 08:16:25 -0000 1.1
+++ tests/synclines.at 23 Apr 2002 09:06:28 -0000
@@ -1,5 +1,5 @@
 # Executing Actions.                               -*- Autotest -*-
-# Copyright 2002 Free Software Foundation, Inc.
+# Copyright (C) 2002 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -33,7 +33,15 @@
 [$2])
 
 AT_CHECK([bison input.y -o input.c])
-AT_CHECK([$CC $CFLAGS $CPPFLAGS input.c -o input], 1, [], [$3])
+AT_CHECK([$CC $CFLAGS $CPPFLAGS input.c -o input], 1, [], [stderr])
+# In case GCC displays column information, strip it down.
+#
+#   input.y:4:2: #error "4"    or input.y:4.2: #error "4"
+# =>
+#   input.y:4: #error "4"
+#
+AT_CHECK([[sed 's/^\([^:]*:[^:.]*\)[.:][^:]*:\(.*\)$/\1:\2/' stderr]],
+         0, [$3])
 AT_CLEANUP
 ])
 



-- 
Ashamed.



reply via email to

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