[libvirt] [PATCH] Mark in_open parameter of remoteAuthenticate as unused when it's unused

Matthias Bolte matthias.bolte at googlemail.com
Tue Apr 20 19:53:41 UTC 2010


2010/4/20 Eric Blake <eblake at redhat.com>:
> On 04/20/2010 12:56 PM, Matthias Bolte wrote:
>> Otherwise compiling with -Werror will fail.
>> ---
>>
>>
>>  static int
>> -remoteAuthenticate (virConnectPtr conn, struct private_data *priv, int in_open,
>> +remoteAuthenticate (virConnectPtr conn, struct private_data *priv, int in_open
>> +#if !HAVE_SASL && !HAVE_POLKIT
>> +                    ATTRIBUTE_UNUSED
>> +#endif
>> +                    ,
>>                      virConnectAuthPtr auth
>>  #if !HAVE_SASL && !HAVE_POLKIT
>>                      ATTRIBUTE_UNUSED
>
> I'd rather use mine instead as it occupies fewer lines and fewer
> #ifdefs.  Paolo Bonzini confirmed off-list that gcc treats
> ATTRIBUTE_UNUSED as _maybe_ unused, not _must be_ unused.
> https://www.redhat.com/archives/libvir-list/2010-April/msg00836.html
>
> So I rebased mine on top of yours and pushed it.
>

Ah, okay. Yes that's more compact and better readable.

Matthias




More information about the libvir-list mailing list