This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: gas warning fixes 8
On Dec 13, 2002, Andrew Cagney <ac131313@redhat.com> 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 http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist Professional serial bug killer