https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425
--- Comment #69 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to Andrew Church from comment #68) > I do agree that "(void)" is very idiomatic, and something like a [[discard]] > statement attribute (which would silence warnings for both > __attribute__((wur)) and [[nodiscard]]) would make the intent clearer. > Perhaps something to suggest for a future version of the C standard? Maybe you want: [[maybe_unused]] auto _ = foo(); This is already in C23.