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. 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?

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...

(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.

Then again, we're getting ahead of ourselves. It hasn't yet been agreed that the warnings should even be implemented.

Joel


_______________________________________________
Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Reply via email to