bison-patches
[Top][All Lists]
Advanced

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

Re: no $$ in %destructor = no unset value warnings?


From: Akim Demaille
Subject: Re: no $$ in %destructor = no unset value warnings?
Date: Thu, 14 Sep 2006 10:29:04 +0200
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux)

>>> "Joel" == Joel E Denny <address@hidden> writes:

 > a. value is likely set/constructed = $$ appears in semantic action
 > b. value is likely destroyed = $$ appears in %destructor

 > That is, I think Bison shouldn't warn about !a when !b.  However,
 > Bison currently considers a value to be likely destroyed by a
 > %destructor regardless of whether $$ appears in the %destructor.  I
 > think that's inconsistent.

It is inconsistent, you are right, but I would have chosen the other
possibility: just like we invite users to YYUSE (or whatever the
macro) in rule actions, we should do that in destructors and printers.
Not because it is always wrong not to use the value, but because it's
always possibly an error.

 > Moreover, it might be convenient to override a per-type or default
 > %destructor by defining an empty per-symbol %destructor, which
 > would suppress the warnings:

 >   %destructor { free ($$); }
 >   %destructor { } symbol_with_no_value

 > What do you think?

Err?  Default destructors apply whether there is a semantic value or
not?  I have plenty of catch-up to do :(





reply via email to

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