On 08/10/2010 09:56 PM, Paul Eggert wrote: > Re that recent change to sort.c to insert a call to ignore_value. > > This ignore_value business is ugly, and > runs against the spirit of the GNU coding standards: > > "Don't make the program ugly to placate lint. > Please don't insert any casts to void." > > <http://www.gnu.org/prep/standards/html_node/Syntactic-Conventions.html> > > How about if we suppress those GCC warnings instead, using > -Wno-unused-result or whatever-it-is? The cost of this > particular warning seems to be greater than its benefits.
I've seen several benefits, such as catching missed error checking on system calls. I'd rather keep -Wunused-result active, for this reason. But since it is debatable which system library headers should be thus marked, I see no option but to have a way to conveniently ignore the warning on the few places where ignoring the result is intentional. Ultimately, ignore_value(x) looks a lot better than (void)x, so we're still complying with the letter of the "no casts to void" if not the spirit. -- Eric Blake [email protected] +1-801-349-2682 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
