qemu-devel
[Top][All Lists]
Advanced

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

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


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH 3/3] Avoid Wunsed-but-set warnings (or errors in case of Werror)
Date: Tue, 05 Jul 2011 09:49:56 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Peter Maydell <address@hidden> writes:

> On 5 July 2011 07:15, Markus Armbruster <address@hidden> 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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]