Sorry for the late reply.
But here is an example that reproduces the error.
First the grammar file:
------------ grammar.y ------------
%name parser
%stack_size 0
%include {
#include <stdlib.h>
#include <assert.h>
}
start ::= sum.
sum ::= atomic PLUS sum.
sum ::= atomic.
atomic ::= LPAREN sum RPAREN.
atomic ::= VALUE.
---------- grammar.y ------------
generating C/C++ code with:
$ lemon grammar.y
Compiling with GCC C compiler works:
$ gcc -c grammar.c
but compiling with g++ C++ compiler doesn't work:
$ g++ -c grammar.c
grammar.c: In function ‘void yyGrowStack(yyParser*)’:
grammar.c:291: error: invalid conversion from ‘void*’ to ‘yyStackEntry*’
However, removing the second line in grammar.y ("%stacksize 0") fixes the
problem, but I think the actual problem is a missing cast in the lempar.c
template file.
I am using Ubuntu 10.4 with g++ 4.4.3 and sqlite3 3.6.22-1.
--
Bad code generation.
https://bugs.launchpad.net/bugs/590399
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs