https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425
--- Comment #76 from Jakub Jelinek <jakub at gcc dot gnu.org> --- (void) casts not quieting the warning was an intentional request when the warning has been added, I really don't think it is a good idea to change that. The fact that clang people can't properly implement Perhaps you can ask glibc to recategorize some of the declarations to use [[nodiscard]] instead of __attribute__((__warn_unused_result__)), IMHO it is helpful to have different badnesses of ignoring the result, WUR attribute should be used for the cases where it is always or pretty much always a very severe bug, while nodiscard can be used for the lighter cases (using the result is nice to have, but usually nothing wrong will happen if it is ignored). E.g. ignoring return value of realloc is pretty much always a bad idea and just (void) realloc (...); is something that shouldn't be supported.