[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 ))
joseph at codesourcery dot com
gcc-bugzilla@gcc.gnu.org
Fri Oct 17 11:24:00 GMT 2008
------- 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
More information about the Gcc-bugs
mailing list