[Bug c/82134] warn_unused_result triggers on empty structs even when they are used

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Nov 13 13:47:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82134

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I don't argue that returning empty structures can be sometimes useful.
But I fail to understand why would you want to use warn_unused_result attribute
on such functions, that just makes no sense, because there is no harm if the
empty struct is not copied to a temporary.


More information about the Gcc-bugs mailing list