This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gas warning fixes 8

On Dec 13, 2002, Andrew Cagney <> wrote:

>>> Did you know that GCC can selectively enable unused warnings and
>>> hence not enable the useless --Wunused-param option?  No need for
>>> all the attribute unused sillyness.
>> How would gcc tell the difference between an intentionally unused
>> parameter, and an accidentally unused parameter?

> It doesn't.  But then, GCC doesn't report an intentionally unused
> parameter that is being used either.

But that's on purpose.  Consider an argument that is only used inside
a preprocessor conditionals.  If it weren't lax about the unused
attribute, you'd have to arrange for the unused attribute to be
conditionally-compiled with a composition of the conditions under
which the variable might be unused.  This can get ugly fast.

That said, perhaps we should have a variant of the unused attribute
that asks gcc to warn if it turns out to be used.  There are times
when this is actually what one would want from it.

Alexandre Oliva   Enjoy Guarana', see
Red Hat GCC Developer                 aoliva@{,}
CS PhD student at IC-Unicamp        oliva@{,}
Free Software Evangelist                Professional serial bug killer

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]