[Bug c/66425] (void) cast doesn't suppress __attribute__((warn_unused_result))
achurch+gcc at achurch dot org
gcc-bugzilla@gcc.gnu.org
Wed Jul 17 10:11:13 GMT 2024
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425
--- Comment #70 from Andrew Church <achurch+gcc at achurch dot org> ---
(In reply to Jonathan Wakely from comment #69)
> Maybe you want:
>
> [[maybe_unused]] auto _ = foo();
If I could apply that attribute to the value itself, i.e.:
[[maybe_unused]] foo();
that would do what I want. Since it only applies to a declaration, we're still
left with idiosyncratic code ("auto _ =" instead of "(void)") which ideally
should not be needed.
More information about the Gcc-bugs
mailing list