[antlr-interest] cast problem with C runtime

Peter C. Chapin pcc482719 at gmail.com
Tue May 19 05:05:54 PDT 2009


On Tue, 19 May 2009, Dragos Tarcatu wrote:

> I'm using antlr-3.1.3 with the C runtime (libantlr3c-3.1.3). I'm
> compiling the generated antlr code for my parser using g++. The thing is
> that for a rule like:
>
> I'm getting a void* conversion error in the generated code:
>
> SVParser.c:1895: error: invalid conversion from void* to
> SVParser_description_return*
>
> Is there a solution to this problem?

C++ does not like conversions from void* to other types without a cast.
However, those conversions are fine in C. Can you compile the generated
code with gcc instead of g++?

Peter


More information about the antlr-interest mailing list