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: Eric Blake
Subject: Re: failure to build due to ignoring fwrite() result
Date: Mon, 30 Aug 2010 09:27:33 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.8) Gecko/20100806 Fedora/3.1.2-1.fc13 Mnenhy/0.8.3 Thunderbird/3.1.2

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.

Therefore, I suggest two families of gnulib wrapper functions:

    xSTDIOFN()
    ySTDIOFN()

wherein ``xfwrite()'' would die if fwrite() fails  (explicitly without
the fflush() check),
and ``yfwrite()'' will ensure no compiler squawks about not checking results.
If this is considered "okay", I'll supply a patch.

I might see using the xfwrite() variant (we already have xfprintf as a gnulib module), but not the yfwrite variant (I would use ignore_value(fwrite) in that case).

--
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org



reply via email to

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