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: Joel E. Denny
Subject: Re: no $$ in %destructor = no unset value warnings?
Date: Thu, 24 Aug 2006 02:35:37 -0400 (EDT)

On Wed, 23 Aug 2006, Paul Eggert wrote:

> "Joel E. Denny" <address@hidden> writes:
> 
> > 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?
> 
> Sounds reasonable to me.  Akim?

To be clear, I was thinking that non-empty %destructor code that doesn't 
contain $$ would not trigger the warnings.  For example, the user may want 
to use %destructor just for messages to the user:

  %destructor {
    fprintf (stderr, "Warning: statement at line %d was discarded.\n",
             @$.first_line);
  } stmt

This scenario has nothing to do with the default or per-type %destructor.

Joel




reply via email to

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