|
From: | Joel E. Denny |
Subject: | Re: %destructor feedback |
Date: | Wed, 7 Dec 2005 18:04:01 -0500 (EST) |
On Wed, 7 Dec 2005, Akim Demaille wrote:
"Joel" == Joel E Denny <address@hidden> writes:> On Wed, 7 Dec 2005, Akim Demaille wrote: >>>>> "Paul" == Paul Eggert <address@hidden> writes: >> >> > Why can't we simply rewrite the code so that it doesn't declare >> > unused variables? >> >> Because you don't know whether yyerror, for instance, will use the >> location, or the %parse-param. But some users need them there. > But the user writes yyerror, and I don't believe YYUSE is documented for > the user to invoke. Right :) Consider the %printers and %destructors for instance.
In those cases, it also seems reasonable to leave it in the hands of the user. That is, if the user doesn't reference a semantic value in its printer or destructor, why did he declare its printer or destructor? Is this a legitimate usage? Shouldn't he be warned *somehow*? Maybe even by bison? Whether $$ occurs can be computed.
In general it seems that, as long as the interface for a passage of user code is documented, any compiler or lint warnings for that code should be the user's problem.
Note that I'm just talking philosophy here. I realize the implementation of this might require an internal redesign, as Paul said.
Joel
[Prev in Thread] | Current Thread | [Next in Thread] |