Re: Re: [RFC 04/21] maint: Add helper macro VIR_USED

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

 



>On Wed, Jun 10, 2020 at 09:20:32AM +0800, Shi Lei wrote:
>> The macro VIR_USED is used in generated parse/format functions to
>> avoid args-unused warnings.
>
>I mentioned in the earlier patch that we can just use G_GNUC_UNUSED
>on any parameters which might be unused. It doesn't matter if they
>really are unused or not. 

Okay.

Regards,
Shi Lei

>
>>
>> Signed-off-by: Shi Lei <shi_lei@xxxxxxxxxxxxxx>
>> ---
>>  src/internal.h | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/src/internal.h b/src/internal.h
>> index e181218..315f12d 100644
>> --- a/src/internal.h
>> +++ b/src/internal.h
>> @@ -502,3 +502,5 @@ enum {
>>  # define fprintf(fh, ...) g_fprintf(fh, __VA_ARGS__)
>> 
>>  #endif /* VIR_NO_GLIB_STDIO */
>> +
>> +#define VIR_USED(var) do { break; } while(var)
>> --
>> 2.17.1
>>
>>
>
>Regards,
>Daniel
>--
>|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
>|: https://libvirt.org -o- https://fstop138.berrange.com :|
>|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
>




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux