bug-gnulib
[Top][All Lists]
Advanced

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

Re: failure to build due to ignoring fwrite() result


From: Paul Eggert
Subject: Re: failure to build due to ignoring fwrite() result
Date: Mon, 30 Aug 2010 12:17:34 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.11) Gecko/20100713 Thunderbird/3.0.6

On 08/30/10 08:27, Eric Blake wrote:
> On 08/30/2010 08:29 AM, Bruce Korb wrote:
>> Every now and then, I'm thumped on the head by something fairly silly.
>> This warning is quite silly:
>>
>>     (void)fwrite(...)
> 
> Gnulib has the ignore-value module for places where casting to void is
> insufficient to shut up gcc.

I share with Bruce Korb the dislike of casting to void, or using ignore_value.
I realize there is a benefit to catching some bugs, but there is also a cost
(a cost that can include causing more bugs), and in this case it's not at all
clear that the benefit exceeds the cost.

In controversial areas like this, we should look to the GNU coding standards
for advice, and they state that one shouldn't cast to void, or use
similar measures merely to satisfy a lint checker.  So I suggest that we
not use ignore-value; instead, we should avoid the GCC options that
generate these warnings.

For gnulib, I suggest that we deprecate the ignore-value module.



reply via email to

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