bug-coreutils
[Top][All Lists]
Advanced

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

bug#15970: ignore_value vs (void) [was: [Bug-tar] bug#15970: bug#15970:


From: Joerg Schilling
Subject: bug#15970: 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 18:05:39 +0100
User-agent: nail 11.22 3/20/05

Eric Blake <address@hidden> wrote:

> On 11/27/2013 09:53 AM, Joerg Schilling wrote:
> >> 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).
> > 
> > Well, there is a more than 30 year history of lint that causes 
> > '(void) write(...)' to be accepted without a warning.
>
> So? Lint is not gcc, and gcc is not lint.  Different compilers have
> different capabilities at producing warnings, and you cannot expect that
> something that works warning-free on one compiler will remain
> warning-free on other compilers (even later versions of the same
> compiler).  Warnings are an art form, and not an exact science,
> precisely because the C standard does not (rather, cannot) specify them.

If you like to stay in an environment that is based on GCC only, you may use 
ignore_value(). If you however like to write portable code, you cannot expect 
something like ignore_value() to be available. Given the fact that other 
compilers honor the (void) cast, it seems that gcc is trying to be different in 
a way that just causes pain but that does not give extra value.

Jörg

-- 
 EMail:address@hidden (home) Jörg Schilling D-13353 Berlin
       address@hidden                (uni)  
       address@hidden (work) Blog: http://schily.blogspot.com/
 URL:  http://cdrecord.berlios.de/private/ ftp://ftp.berlios.de/pub/schily





reply via email to

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