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: Bruce Korb
Subject: Re: failure to build due to ignoring fwrite() result
Date: Mon, 30 Aug 2010 13:01:39 -0700

Howdy, another penny or two:

On Mon, Aug 30, 2010 at 12:52 PM, Jim Meyering <address@hidden> wrote:
> Hi Paul,

> The solution here could be to make gnulib provide a better declaration of
> fwrite: one without the offending attribute.  Deprecating ignore-value or
> somehow disabling all warn_unused_result attributes would be overkill --
> no reason to throw the baby out with the bathwater.

Meanwhile, gcc has added a new warning suppression option,
--no-warn-unused-result (or very similar).  That, I believe, does toss the
baby, too.  I don't know so much about the uniqueness of fwrite, viz.
why it is ignorable and fputc is not.  I like simple rules that minimize
the amount of stuff that has to be remembered:

1.  prefix it with an "x" and it won't return if it doesn't work
2.  prefix it with a "void_" (or even "y"), and you are saying
    "trust me, I know what I am doing.  You are merely a compiler"

It eliminates having to remember, "does this use this prefix?"



reply via email to

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