Re: [Qemu-devel] [PATCH 3/3] Avoid Wunsed-but-set warnings (or errors in case of Werror)

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

 



Peter Maydell <peter.maydell@xxxxxxxxxx> writes:

> On 5 July 2011 07:15, Markus Armbruster <armbru@xxxxxxxxxx> wrote:
>>> +    int fd, __attribute__((unused)) ret;
>>>
>>>      snprintf(reset_file, sizeof(reset_file),
>>>               "/sys/bus/pci/devices/%04x:%02x:%02x.%01x/reset",
>>
>> What about (void)write() and do away with ret?
>
> If 'ret' has been used to silence compiler warnings about functions
> which have been declared with attribute __warn_unused_result__
> (eg write() and various other libc functions) then "(void)write()"
> is insufficient -- gcc requires the variable.

gcc being silly.  Oh well.
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux