Akim Demaille <[EMAIL PROTECTED]> writes:
> I'd rather say that we should special case YYUSE. For instance when
> the compiler is GCC, or when lint is used etc. From this thread it
> seems there is no single answer, let's forge a multiple one.
Unfortunately I don't think that would work, because lint discards
its funny comments when used inside macros. So, for example, if we
did this:
#if defined lint
# define YYUSE(e) do {;} while (/*CONSTCOND*/ 0 && (e))
#else
# define YYUSE(e) ((void) (e))
#endif
the /*CONSTCOND*/ is lost before lint "sees" it, so lint complains
about the constant expression in the use. (This is the problem we're
currently facing with the existing YYUSE.)
We could dump YYUSE, and replace all instances of
YYUSE(e);
with
#ifdef __GNUC__
(void) (e);
#else
do {;} while (/*CONSTCOND*/ 0 && (e));
#endif
This could be done with an m4 macro, I suppose. The resulting parser
would look ugly though, and be even harder to maintain.
More in keeping with lint would be to put /*ARGUSED*/ in the skelton,
before every function that uses YYUSE. A bit ugly too, but perhaps
that's the simplest solution.