[Patch] redundant ATTRIBUTE_UNUSED in elf32-bfin.c

Dave Korn dave.korn.cygwin@googlemail.com
Mon May 11 04:20:00 GMT 2009


Mike Frysinger wrote:
> On Sunday 10 May 2009 19:35:33 Dave Korn wrote:
>> Mike Frysinger wrote:
>>> On Saturday 09 May 2009 23:03:18 Masaki Muranaka wrote:
>>>> There are some redundant ATTRIBUTE_UNUSEDs in elf32-bfin.c
>>>> These may be harmless but should be fixed for trusted code.
>>> sorry, but how are they redundant ?
>>   It looks to me like they are redundant because the argument in question
>> is, in fact, used, after all, probably as a result of the code evolving
>> since the prototype for the function was first written.
> 
> i wouldnt describe that as redundant which is why i was asking for more info.  
> if the variable is actually used, then having unused attribute marking sounds 
> like the code is wrong.

  I think "wrong" is too strong:

" `unused'
     This attribute, attached to a variable, means that the variable is
     meant to be possibly unused.  GCC will not produce a warning for
     this variable. "

... note the "possibly".  It is entirely permitted to attach a 'unused'
attribute to an in-fact-used variable (deliberately and by design so), but it
is "superfluous; exceeding what is necessary; excess: more than is needed,
desired, or required;", and other such definitions of redundant.

    cheers,
      DaveK



More information about the Binutils mailing list