[Top][All Lists]

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

Re: can I suppress "invalid unused variable name"?

From: Tom Tromey
Subject: Re: can I suppress "invalid unused variable name"?
Date: 11 Aug 2001 15:44:54 -0600

>>>>> "Steve" == Steve M Robbins <address@hidden> writes:

Steve> However, you sent to bug-automake.  I'm re-sending to the
Steve> automake discussion list, since (a) I'm not sure it is a bug,
Steve> and (b) someone in the wider audience may know a workaround.

Steve>  LDADD = ... $(CGAL_LDFLAGS) ...
Steve> and automake complains:
Steve> invalid unused variable name: `CGAL_LDFLAGS'

This is a "feature".  I'll explain why it exists and what it does;
then we can discuss whether it is really worth keeping.

Certain variable suffixes are considered special by automake.  For
instance, _SOURCES (full list as of right now: _SOURCES, _LIBADD,
_LDADD, _LDFLAGS, _DEPENDENCIES).  Automake assumes that a variable with
one of these extensions must be attached to some specific program.  If
you use one with a prefix that doesn't correspond to a program (e.g.,
"CGAL_LDFLAGS" -- you probably don't have a "CGAL" program), then
automake will print this message.

The reason for this is that it is pretty easy to introduce a typo and
get silently wrong behavior from automake.  As I recall, in the
distant past there were a few bug reports along this line and I
finally decided to implement typo checking.

Automake has a few things like this.  They seemed like good ideas way
back when.  But now I wonder if automake isn't trying a bit too hard;
maybe we should assume the user knows more.  There's a fine line here
between catching legitimate errors (things that in a tighter language
like C would cause link errors or whatever) and being a nanny.

In your case the workaround is to rename the variable.  This is what
makes the feature seem like a potential misfeature -- it is natural to
want to name it the way you did.

Steve> [Incidentally, there used to be a line number attached to this
Steve> diagnostic, but that suddenly stopped. (??)]

Thanks.  This is definitely a bug.  Could you submit a PR to Gnats?


reply via email to

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