bug-bison
[Top][All Lists]
Advanced

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

Re: %destructor feedback


From: Frank Heckenbach
Subject: Re: %destructor feedback
Date: Sun, 23 Oct 2005 04:58:54 +0200
User-agent: semail 20050409

Joel E. Denny wrote:

> On Sun, 23 Oct 2005, Frank Heckenbach wrote:
> 
> > Yes. And it wouldn't be backward-compatible with older Bison
> > versions that don't have YYUSE. I guess one could #ifdef around it.
> 
> YYUSE is really a no-op.  In other words:
> 
>    $5;
> 
> is nearly equivalent to:
> 
>    YYUSE($5);
> 
> The first would be compatible with any bison version.

... and would likely produce a compiler-warning. Exchanging a Bison
warning for a compiler warning doesn't really gain much.

> The second is
> mostly just for better code readability. If the user wants YYUSE plus 
> backward compatibility, then he can just add his own definition for YYUSE 
> #ifndef YYUSE.  That's pretty simple.  Is that what you meant?

Basically yes. (Though the recent development of YYUSE and your
following comment seem to show that it isn't quite that easy to
write a general-purpose warning-free YYUSE ...)

> However, I just noticed the current YYUSE definition doesn't allow the 
> argument to be a struct instance.  Paul, Akim, is this intentional?

> > OTOH, making the warning optional shouldn't take more than a global
> > flag in Bison unless I'm missing something.
> 
> If someone wants to implement the global flag, I won't argue.  I just 
> worry that...

I guess I could write those few lines, if that's the main problem. ;-)

> > (Newly written code
> > without backward-compatibility concerns could, and perhaps should,
> > still use YYUSE then, of course.)
> 
> few users will notice that YYUSE is better, most users will declare the 
> global flag, and so the warnings will be a mostly useless feature.

This might be a valid point. But perhaps few will note the global
flag either. I think it's mostly a matter of documentation
(including recommendation) and announcement ...

Frank

-- 
Frank Heckenbach, address@hidden
http://fjf.gnu.de/
GnuPG and PGP keys: http://fjf.gnu.de/plan (7977168E)




reply via email to

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