[PATCH FOR REVIEW]: Fix warning in src/share/vm/adlc/archDesc.cpp
Christian.Thalinger at Sun.COM
Sat Sep 5 01:59:16 PDT 2009
Christian Thalinger wrote:
> Andrew John Hughes wrote:
>> 2009/9/4 Paul Hohensee <Paul.Hohensee at sun.com>:
>>> Try a cast to (void).
>> As I said (or meant to, mental typo), this doesn't fix it. GCC still complains.
> Yeah, there already were some discussions about this new behavior and I
> personally don't really like it. When I want to ignore a return value
> the compiler should honor that and go ahead. Is there a compiler flag
> to turn that behavior off?
Well, looking more closely it's actually a system header attribute that
brings up that warning:
error: ignoring return value of 'size_t fwrite(const void*, size_t,
size_t, FILE*)', declared with attribute warn_unused_result
And it seems there is no GCC switch to turn that warning off (except
-O0). Maybe we should check for the written bytes to be the same as
assert(count == size, "copyright info truncated");
More information about the hotspot-dev