[Top][All Lists]

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

Re: CVS Bison (2002-10-20) creates empty structures and initializers

From: Paul Eggert
Subject: Re: CVS Bison (2002-10-20) creates empty structures and initializers
Date: Tue, 22 Oct 2002 23:41:48 -0700 (PDT)

> From: Akim Demaille <address@hidden>
> Date: 22 Oct 2002 10:33:45 +0200
> I'm not sure how to solve this issue.  I'm not fond _at all_ of
> conditionalizing all the code that uses locations :(

This indicates a bit of a shortcoming in our current technology, as it
should be easier to conditionalize things like that.

I am thinking of suggesting that we go back to using the C
preprocessor to conditionalize C code, at least when this is easy.
With the C preprocessor, one can decide at C-compile-time (rather than
at Bison-compile-time) whether to enable or disable a conditional
feature.  Also, it's easier for non-M4 programmers to follow what's
going on.

But this should wait until after Bison 2.0 come sout.

> Maybe this is the right time to try to have a single stack in GLR?

That sounds like a good idea, but how about if we wait until after
Bison 2.0 is out for that, too?  In the meantime I have installed the
following conservative patch, which works around the problem for Sun
ONE Studio 7 cc.  I hope this also fixes the related problem with
SunOS 4.1.4 gcc reported by Peter Klein.

2002-10-22  Paul Eggert  <address@hidden>

        * data/glr.c (struct yyltype): Define members even when not
        doing locations.  This is more consistent with yacc.c, and it
        works around the following bug reports:
        and I hope it also fixes this bug report:

Index: glr.c
RCS file: /cvsroot/bison/bison/data/glr.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -p -u -r1.22 -r1.23
--- glr.c       20 Oct 2002 16:09:47 -0000      1.22
+++ glr.c       23 Oct 2002 06:30:49 -0000      1.23
@@ -178,11 +178,10 @@ typedef union b4_stype yystype;
 #ifndef YYLTYPE
 typedef struct yyltype
   int first_line;
   int first_column;
   int last_line;
-  int last_column;])[
+  int last_column;
 } yyltype;
 # define YYLTYPE ]b4_location_type[

reply via email to

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