This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/35579] [4.1/4.2/4.3/4.4 Regression] casts to void do not silence -Wunused warnings for the case of __attribute__(( warn_unused_result ))
- From: "joseph at codesourcery dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Oct 2008 11:22:53 -0000
- Subject: [Bug c/35579] [4.1/4.2/4.3/4.4 Regression] casts to void do not silence -Wunused warnings for the case of __attribute__(( warn_unused_result ))
- References: <bug-35579-15916@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #8 from joseph at codesourcery dot com 2008-10-17 11:22 -------
Subject: Re: [4.1/4.2/4.3/4.4 Regression] casts to void do not
silence -Wunused warnings for the case of __attribute__(( warn_unused_result
))
On Fri, 17 Oct 2008, bonzini at gnu dot org wrote:
> It seems bad that *explicit* casts to void cannot silence the warning. This is
> a problem for projects using -Werror and using (void) with due diligence
> (including GNU coreutils).
The maintainers of a library using this attribute in its headers have
decided that casting the return value of the relevant functions to (void)
is an incorrect use of those functions. The testsuite duly checks for
these semantics. If you disagree with a library maintainer's decision,
you should bring that up with the library maintainers. This was discussed
at length in bug 25509.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35579