RFR: 8263718: unused-result warning happens at os_linux.cpp
Magnus Ihse Bursie
ihse at openjdk.java.net
Wed Mar 17 16:48:48 UTC 2021
On Wed, 17 Mar 2021 13:35:36 GMT, Yasumasa Suenaga <ysuenaga at openjdk.org> wrote:
>> I see. I found this page:
>> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425
>
> Thanks @stefank !
> Status of the Bugzilla ticket which you told is unconfirmed (and it does not seem to be updated since last year!).
>
> I want to suppress the warning if we cannot remove `alloca()` call.
Did you notice this workaround in the gcc bug report?
"Note that a logical negation prior to cast to void is sufficient to suppress the warning:
int void_cast_should_not_warn() {
(void) !foo();
// ^-- here
return 0;
}
"
-------------
PR: https://git.openjdk.java.net/jdk/pull/3042
More information about the hotspot-dev
mailing list