fix hotspot build failures with -D_FORTIFY_SOURCE=2 and -Wformat=1
doko at ubuntu.com
Wed Dec 3 12:36:35 PST 2008
Kelly O'Hair schrieb:
> Casting a function call to (void) is a well defined, well understood
> and explicit language syntax. The function return is being explicitly
> If we have to jump through hoops for this gcc then maybe the -Werror should
> just be turned off for this gcc release in the Makefiles.
> Christian Thalinger wrote:
>> On Wed, 2008-12-03 at 14:46 +0100, Matthias Klose wrote:
>>> int fn () __attribute__ ((warn_unused_result));
>>> int foo ()
>>> if (fn () < 0) return -1;
>>> (void) fn ();
>>> return 0;
>>> gcc (4.3.x, 4.4) still warns about the unused return value.
>> I see the problem. write is defined with __wur (which is most likely
>> __attribute__ ((warn_unused_result)), I did not check) in glibc-2.7, but
>> not in e.g. glibc-2.3.6, and GCC warns about it even when a (void) cast
>> is used.
>> I'd say this is a bug in GCC. When I explicitly ask for ignoring the
>> return value, it should do it.
this is http://gcc.gnu.org/PR25509, not seen as a bug in GCC. I'll discuss a
solution for Ubuntu with my coworkers next week.
More information about the distro-pkg-dev