GNU bug report logs - #15970
[Bug-tar] Crash in gettext() after fork() on Mac OS X

Previous Next

Package: coreutils;

Reported by: Paul Eggert <eggert <at> cs.ucla.edu>

Date: Mon, 25 Nov 2013 00:11:02 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


Message #43 received at 15970 <at> debbugs.gnu.org (full text, mbox):

From: Eric Blake <eblake <at> redhat.com>
To: Joerg Schilling <Joerg.Schilling <at> fokus.fraunhofer.de>, P <at> draigBrady.com
Cc: eggert <at> cs.ucla.edu, 15970 <at> debbugs.gnu.org, bug-tar <at> gnu.org
Subject: ignore_value vs (void) [was: [Bug-tar] bug#15970: bug#15970: Crash
 in gettext() after fork() on Mac OS X]
Date: Wed, 27 Nov 2013 09:44:06 -0700
[Message part 1 (text/plain, inline)]
On 11/27/2013 09:30 AM, Joerg Schilling wrote:
>>> Are you using "ignore_value" because of the gcc bug that ignores the official
>>> method to tell that the return code is ignored intentionally:
>>>
>>> 	(void) write(fd, buf, len);

The C standard does not document that '(void) write(...)' is required to
avoid diagnostics, so I don't see the gcc behavior as a bug (yes, it's
annoying behavior, but that doesn't make it incorrect behavior).

> Do you believe this is the right method to deal with the problem?

We're already stuck with compilers in the wild where casting to void is
insufficient to shut up the compiler warnings, so at this point in time,
any GNU code that wants to avoid warnings is better off using gnulib's
ignore_value() than a cast to void.  At which point, it should not
matter what ignore_value() uses under the hood (personally, I PREFER use
of ignore_value() - function syntax is easier to read as declaring the
intent of what I'm doing than cast syntax, and a coding style that
minimizes casts is preferred).

> It will most likely prevent to create enough pressure on the GCC people to fix 
> the current warning problem.

No, I don't think that gnulib's use of ignore_value() is enough pressure
to make gcc change their warning behavior.  Nor do I care - even if gcc
changes behavior, I still plan on using ignore_value() (and let gnulib
figure out how to map ignore_value to the most efficient semantics for
each compiler it is tested with).

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

[signature.asc (application/pgp-signature, attachment)]

This bug report was last modified 11 years and 180 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.