bug-bison
[Top][All Lists]
Advanced

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

Re: type clash on default action: <NONE> != <>


From: Martin MOKREJŠ
Subject: Re: type clash on default action: <NONE> != <>
Date: Sun, 8 Dec 2002 01:40:23 +0100 (CET)

Hi Paul,
  thanks for the patch. I've tried bison 1.75c on Tru64Unix 5.1A box and
have some problems compiling kerberos4:

$ bison -y -d  `test -f 'parse.y' || echo './'`parse.y
IOT/Abort trap (core dumped)
$ hash
hits    command
   1    /software/@sys/usr/bin/bison
$ dbx /software/@sys/usr/bin/bison core
dbx version 5.1
Type 'help' for help.
Core file created by program "bison"

signal IOT/Abort trap at >*[__kill, 0x12008a648]        beq     a3, 0x12008a660
(dbx) where
>  0 __kill(0x0, 0x5, 0x100000000, 0x3df29428, 0x120064434) [0x12008a648]
   1 (unknown)() [0x120073438]
   2 __tis_raise(0x120064434, 0x140036d40, 0x120074d58, 0x6, 0x12007dbf4) 
[0x120074d54]
   3 raise(0x120074d58, 0x6, 0x12007dbf4, 0x14009d23a, 0x120064464) 
[0x12007dbf0]
   4 abort(0x1200433bc, 0x14009d239, 0x0, 0x0, 0x0) [0x120064460]
   5 skel_lex() ["scan-skel.c":73, 0x1200433b8]
   6 scan_skel(in = 0x140006620) ["scan-skel.l":91, 0x1200442b0]
   7 output_skeleton() ["output.c":576, 0x120030838]
   8 output() ["output.c":633, 0x120031f00]
   9 main(argc = 4, argv = 0x11fffc018) ["main.c":153, 0x120025570]
(dbx) quit
$ /software/@sys/usr/bin/bison --version
bison (GNU Bison) 1.75c

Hope this helps to find the problem.


On Sat, 30 Nov 2002, Paul Eggert wrote:

> > From: <address@hidden>
> > Date: Mon, 25 Nov 2002 13:05:57 +0100 (CET)
>
> >   I have the following problem with bison-1.75 and also 1.75c when
> > compiling mysql-4.0 sources on Linux i386:
> >
> > make[2]: Entering directory `/usr/scratch/mysql-4.0/sql'
> > /usr/local/bin/bison -y -d  sql_yacc.yy && mv y.tab.c sql_yacc.cc
> > sql_yacc.yy:666.7-672.21: type clash on default action: <NONE> != <>
>
> Do you know the story behind those <NONE> declarations in the MySQL
> grammar?  You can fix the problem by removing the two "%type
> <NONE>..." declarations.  I don't know why those declarations are
> needed.
>
> That being said, it appears to me that Bison is being too strict about
> type clashes.  I can construct a grammar that contains lots of type
> clashes, but which ignores the corresponding values, and POSIX seems
> to allow such a grammar.  So I have installed the following patch,
> which should downgrade those error messages to warnings.
>
> 2002-11-30  Paul Eggert  <address@hidden>
>
>       Type clashes now generate warnings, not errors, since it
>       appears that POSIX may allow some grammars with type clashes.
>       * src/reader.c (grammar_current_rule_check): Warn about
>       type clashes instead of complaining.
>       * tests/input.at (Type Clashes): Expect warnings, not complaints.
>
> Index: src/reader.c
> ===================================================================
> RCS file: /cvsroot/bison/bison/src/reader.c,v
> retrieving revision 1.225
> diff -p -u -r1.225 reader.c
> --- src/reader.c      29 Nov 2002 05:59:59 -0000      1.225
> +++ src/reader.c      30 Nov 2002 09:48:54 -0000
> @@ -260,14 +260,14 @@ grammar_current_rule_check (void)
>      {
>        const char *rhs_type = first_rhs->type_name ? first_rhs->type_name : 
> "";
>        if (!STRUNIQ_EQ (lhs_type, rhs_type))
> -     complain_at (current_rule->location,
> -                  _("type clash on default action: <%s> != <%s>"),
> -                  lhs_type, rhs_type);
> +     warn_at (current_rule->location,
> +              _("type clash on default action: <%s> != <%s>"),
> +              lhs_type, rhs_type);
>      }
>    /* Warn if there is no default for $$ but we need one.  */
>    else
> -    complain_at (current_rule->location,
> -              _("empty rule for typed nonterminal, and no action"));
> +    warn_at (current_rule->location,
> +          _("empty rule for typed nonterminal, and no action"));
>  }
>
>
> Index: tests/input.at
> ===================================================================
> RCS file: /cvsroot/bison/bison/tests/input.at,v
> retrieving revision 1.21
> diff -p -u -r1.21 input.at
> --- tests/input.at    14 Nov 2002 22:53:47 -0000      1.21
> +++ tests/input.at    30 Nov 2002 09:48:54 -0000
> @@ -73,10 +73,10 @@ exp: foo {} foo
>     ;
>  ]])
>
> -AT_CHECK([bison input.y], [1], [],
> -[[input.y:4.4-15: type clash on default action: <bar> != <>
> -input.y:5.4-8: type clash on default action: <bar> != <>
> -input.y:6.4: empty rule for typed nonterminal, and no action
> +AT_CHECK([bison input.y], [], [],
> +[[input.y:4.4-15: warning: type clash on default action: <bar> != <>
> +input.y:5.4-8: warning: type clash on default action: <bar> != <>
> +input.y:6.4: warning: empty rule for typed nonterminal, and no action
>  ]])
>
>  AT_CLEANUP
>

-- 
Martin Mokrejs <address@hidden>, <address@hidden>
PGP5.0i key is at http://www.natur.cuni.cz/~mmokrejs
MIPS / Institute for Bioinformatics <http://mips.gsf.de>
GSF - National Research Center for Environment and Health
Ingolstaedter Landstrasse 1, D-85764 Neuherberg, Germany
tel.: +49-89-3187 3683 , fax: +49-89-3187 3585





reply via email to

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