help-bison
[Top][All Lists]
Advanced

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

RE: How to get rid of warnings in Bison?


From: Colin Daley
Subject: RE: How to get rid of warnings in Bison?
Date: Tue, 30 Jul 2013 17:15:34 -0500

On Tue, 30 Jul 2013 21:52:19 +0200, Bernd Clausen wrote:
> 
> Hi,
> 
> I get a lot of warnings in my project. Here is one excerpt of my grammar file:
> 
> stmtlist : stmt ';'           { printf(".."); }
>          | stmtlist stmt ';'  { printf(".."); }
> ;
> 
> 1. line -> warning: unused value: $1
> 2. line -> warning: unused value: $2
> 
> The problem is that I don't want to use $1 and $2. Is there a better
> solution to get rid of these warnings than to call Bison with 
> "-Wno-other"???
> 

Hello Bernd,

When I had the same problem I found the following suggestion:

> For now, we usually declare this intentional omission using a preprocessor 

> macro.  You could define it as:

>
> #define USE(VALUE) /*empty*/ 

and then write:
USE($1)
etc.

You can see the whole thread here:
http://old.nabble.com/warning%3A-unused-value%3A-$3-td6997506.html

I did not bother to try it myself.

Regards,
Colin Daley.

                                          

reply via email to

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