fix hotspot build failures with -D_FORTIFY_SOURCE=2 and -Wformat=1
Tom Tromey
tromey at redhat.com
Mon Dec 8 10:37:26 PST 2008
>>>>> ">" == Xiaobin Lu <Xiaobin.Lu at Sun.COM> writes:
>> I agree it is ugly to use a unused local variable to make the
>> aggressive compiler happy, but I don't find other options such as
>> pragam etc to get around this.
You could try an inline wrapper function. This did not warn for me:
int fn () __attribute__ ((warn_unused_result));
static inline int fn2() { return fn (); }
int foo ()
{
fn2 ();
return 0;
}
I don't know whether or not this would be considered a bug in gcc,
though.
Tom
More information about the distro-pkg-dev
mailing list